E-mail Posted September 21, 2011 Share Posted September 21, 2011 Hi i have made this on player wasted i want destroy image in 5 sec after Player die ! local x,y = guiGetScreenSize() function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) blood = guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) setTimer ( wasted, 10000, 1,"images/firstblood.png" ) Link to comment
JR10 Posted September 21, 2011 Share Posted September 21, 2011 local x,y = guiGetScreenSize() function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) blood = guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) setTimer ( function() destroyElement ( blood ) end, 5000, 1 ) Link to comment
E-mail Posted September 21, 2011 Author Share Posted September 21, 2011 client.lua:8: Bad argument @ "destroyElement" Link to comment
qaisjp Posted September 21, 2011 Share Posted September 21, 2011 (edited) local x,y,blood = guiGetScreenSize(), guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 5000, 1, blood, false ) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) Edited September 21, 2011 by Guest Link to comment
TAPL Posted September 21, 2011 Share Posted September 21, 2011 local blood = guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 5000, 1, blood, false ) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) Link to comment
E-mail Posted September 21, 2011 Author Share Posted September 21, 2011 hi Tapl i want if Player died gameSpeed set to 3.0 and back to normal after 5 sec ... see local blood = guiCreateStaticImage(0.2611,0.5067,0.4826,0.1111,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 2000, 1, blood, false ) setGameSpeed(tonumber(0.3) addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) Link to comment
qaisjp Posted September 21, 2011 Share Posted September 21, 2011 local x,y,w,h = 0.2611, 0.5067, 0.4826, 0.1111 local blood = guiCreateStaticImage(x,y,w,h,"images/firstblood.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) local sound = playSound("sounds/wasted.ogg") setSoundVolume(sound, 0.5) guiSetVisible(blood, true) setTimer (guiSetVisible, 2000, 1, blood, false ) setGameSpeed(tonumber(3) setTimer(setGameSpeed, 1, 5000, 1) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) It's not nice if you are addressing someone for help, but posting in a forum. Link to comment
E-mail Posted September 21, 2011 Author Share Posted September 21, 2011 /debugscript 3 say client.lua:12:")"expected (to close"("at line 11) near "setTimer" Link to comment
BinSlayer1 Posted September 21, 2011 Share Posted September 21, 2011 So fix what debugscript said? Lazy people.. setGameSpeed(tonumber(3) Should be setGameSpeed(tonumber(3)) don't just copy paste everything damnit, try to learn so you don't ask everytime 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