villr Posted September 6, 2010 Share Posted September 6, 2010 Hi im making a rpg script right now and when a player die i want the gui to show up again but when a player dies it show for all... Here is code addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end) What is wrong? Why does it show for all?? Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 looks fine, should be visible only for local player O_O - maybe theres a bug, but bugtracker is down.. try onClientPedWasted instead (attached to getLocalPlayer() of course) - it's almost the same Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 so i dont will remove getLocalPlayer? It will be on same place? And remove OnClientplayerblablabla adn put in OnClientped blabla? Link to comment
Discord Moderators Zango Posted September 6, 2010 Discord Moderators Share Posted September 6, 2010 so i dont will remove getLocalPlayer?It will be on same place? And remove OnClientplayerblablabla adn put in OnClientped blabla? Sounds like it Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 hmm i get a error about getlocalplayer attempt to call global 'getLocalPlayer' It what error said I havent try it yet but why it comes a error? Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 you probably forgot about brackets -> () getLocalPlayer() not getLocalPlayer Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 Still get that error message in Console Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 The code is now addEventHandler( "onClientPedWasted",getLocalPlayer()), function( ) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end) Is it right? Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 Oh that error code was from a other script Sorry for that but we have try the script but it dont work so u know how to fix it or u think its a bug? Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 addEventHandler( "onClientPedWasted",getLocalPlayer(), -- one ) goes out function( ) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end) Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 Haha im very ^^ so what shold be there? Is the -- a nedd or something or should i remove the last one or something? Haha im just a little^^^^ nooby:P Im a new scripter Link to comment
Wojak Posted September 6, 2010 Share Posted September 6, 2010 maybe try: addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) if source == getLocalPlayer( ) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end end) Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 after -- there is my comment (lua will not parse anthing after --) about what you did wrong in last script. you can copy & paste and use it, even with that comment Wojak fixed script: (his idea can be good one, if onClientPlayerWasted triggers for all players even when attached to getLocalPlayer() - but have you tried onClientPedWasted successfully?) addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) if source == getLocalPlayer( ) then -- Wojak forgot about "then" here guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end end) Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 Thx guys i will try now hope it works Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 post your current script Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 The code dosent work Still when a player die the gui show up Do the gui need to be in a window or something beacuse my spawning gui is only a gridlist...? Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 post your current script Code or script? With script do u mean all in the script or only codes? I wanna send them in msn if u goot Link to comment
villr Posted September 6, 2010 Author Share Posted September 6, 2010 I mean if its a script i send by msn or hotmail or if a only a code of it or something i post it here Link to comment
dzek (varez) Posted September 6, 2010 Share Posted September 6, 2010 Could You please use edit button instead of triple posting? I meant the part that is not working.probably same part as in first post.id like to see what have you changed since first post Link to comment
villr Posted September 7, 2010 Author Share Posted September 7, 2010 Hmm im starting to think about one thing in script... What are the funciton doing is it requied or i need to remove it?? First script was addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end) and now it is addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) if source == getLocalPlayer( ) then -- Wojak forgot about "then" here guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end end) Link to comment
dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 and is it working or not? even heard about debugging? addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), function( ) if source == getLocalPlayer( ) then -- Wojak forgot about "then" here local name = getPlayerName(source) outputDebugString("player that died: "..name..", local player: "..getPlayerName(getLocalPlayer())) guiSetVisible (spawnmenugrid, true ) guiSetVisible(spawnmenumemo,true) showCursor ( true ) showPlayerHudComponent("radar",false) showChat(false) end end ) Link to comment
villr Posted September 7, 2010 Author Share Posted September 7, 2010 I will try that new code hope it works If u mean that /debugscript so yea i heard about it Its not on my server im testing but im admin there so i can check and the gui are showing upp for people when the die but i will try the new Link to comment
dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 No, I DONT MEAN debugscript - debugscript is only a window - and you should learn how to do thing called debug - so read that wiki page i posted!! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now