Franc[e]sco Posted January 6, 2008 Share Posted January 6, 2008 I dunno if it's a LUA bug but even if the code seems perfect my onClientPlayerWasted doesnt even call, it doesnt give any error or any debug i setted... here's the code (client-sided script) -- Simple dm 0.1a coded by Franc[e]sco --//--------------------------------------------------------------------------// addEventHandler ( "onClientResourceStart",getResourceRootElement(getThisResource()), function() local gogogo = guiCreateLabel ( 0, 0.2, 1, 0.5, "Go Go Go! Kill as much as you can!", true ) guiSetFont ( gogogo, "sa-gothic" ) guiLabelSetColor ( gogogo, 206, 0, 5 ) guiLabelSetHorizontalAlign ( gogogo, "center", false ) setTimer ( destroyElement, 10000, 1, gogogo ) end ) --//--------------------------------------------------------------------------// function playerGotPwned (killer, weapon, bodypart) outputDebugString("onClientPlayerWasted called") secondsleft = 10 outputDebugString("Seconds before respawn: " ..secondsleft) countdownToSpawn = guiCreateLabel ( 0, 0.2, 1, 0.5, secondsleft, true ) guiSetFont (countdownToSpawn, "sa-gothic" ) guiLabelSetColor (countdownToSpawn, 206, 0, 5) guiLabelSetHorizontalAlign (countdownToSpawn, "center", false) outputDebugString("GUI created") setTimer (destroyElement, 10000, 1, countdownToSpawn) outputDebugString("setted timer to destroy countdownToSpawn") setTimer (countdownFunction, 1000, 10) outputDebugString("setted timer to countdownFunction") setGuiVisible(countdownToSpawn, true) outputDebugString("setted gui to visible") end addEventHandler ("onClientPlayerWasted", getLocalPlayer(), playerGotPwned) --//--------------------------------------------------------------------------// function countdownFunction () secondsleft = secondsleft-1 outputDebugString(secondsleft) guiSetText (countdownToSpawn, secondsleft) end --//--------------------------------------------------------------------------// Link to comment
ChrML Posted January 6, 2008 Share Posted January 6, 2008 Do a /debugscript 3 in the console. Do you see any errors? Link to comment
Franc[e]sco Posted January 7, 2008 Author Share Posted January 7, 2008 Screen i think something's wrong in the script Link to comment
DracoBlue Posted January 11, 2008 Share Posted January 11, 2008 Screen i think something's wrong in the script As you can see, it is triggered, but you are using an unknown function called setGuiVisible in line 26. Happy coding, Jan (DracoBlue) Link to comment
[email protected] Posted January 12, 2008 Share Posted January 12, 2008 Screen i think something's wrong in the script As you can see, it is triggered, but you are using an unknown function called setGuiVisible in line 26. Happy coding, Jan (DracoBlue) also make sure that you added the event client-side (in your client-script: addEvent("event name", true), true needs to be supplied to make it remotely triggerable, by your serverscript for example ) Link to comment
Franc[e]sco Posted January 13, 2008 Author Share Posted January 13, 2008 Thanks, solved 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