12p Posted July 17, 2010 Posted July 17, 2010 Well, guys, It's me again . I'm okay, I'm learning how LUA works, and I'm progressing, but I have 1 problem... Look at this code: function respawn (player) fadeCamera(player,true,1,255,255,255) spawnPlayer(player,2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74, 180, 285) setCameraTarget(player, player) end addEventHandler("onPlayerWasted", root, function () setTimer (respawn,3000,1,source) end) My objetive with that code, is to make the player spawn when he dies, after 3 seconds, and fade the camera before that. Everything works good but the Fade Out effect... what's bad in that code? Thank you beforehand.
50p Posted July 17, 2010 Posted July 17, 2010 You want to fade out when player dies and fade in when he spawns? If so, how do you expect the camera to fade out when player dies if you don't use fadeCamera in onPlayerWasted event at all? That's logical.
m4rsje Posted July 17, 2010 Posted July 17, 2010 Well, guys, It's me again . I'm okay, I'm learning how LUA works, and I'm progressing, but I have 1 problem...Look at this code: function respawn (player) fadeCamera(player,true,1,255,255,255) spawnPlayer(player,2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74, 180, 285) setCameraTarget(player, player) end addEventHandler("onPlayerWasted", root, function () setTimer (respawn,3000,1,source) end) My objetive with that code, is to make the player spawn when he dies, after 3 seconds, and fade the camera before that. Everything works good but the Fade Out effect... what's bad in that code? Thank you beforehand. its not that hard, all you have to do is this: local root = getRootElement() addEventHandler("onPlayerWasted", root, function () setTimer (spawnPlayer, 5000, 1, source,2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74) end ) not that hard i guess ^^
50p Posted July 17, 2010 Posted July 17, 2010 Well, guys, It's me again . I'm okay, I'm learning how LUA works, and I'm progressing, but I have 1 problem...Look at this code: function respawn (player) fadeCamera(player,true,1,255,255,255) spawnPlayer(player,2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74, 180, 285) setCameraTarget(player, player) end addEventHandler("onPlayerWasted", root, function () setTimer (respawn,3000,1,source) end) My objetive with that code, is to make the player spawn when he dies, after 3 seconds, and fade the camera before that. Everything works good but the Fade Out effect... what's bad in that code? Thank you beforehand. its not that hard, all you have to do is this: local root = getRootElement() addEventHandler("onPlayerWasted", root, function () setTimer (spawnPlayer, 5000, 1, source,2314.75+math.random(-1,1), -6.43+math.random(-1,1), 26.74) end ) not that hard i guess ^^ Do you even read what he's asking for?
12p Posted July 17, 2010 Author Posted July 17, 2010 , thanks 50p. Thank you very much. Please close this thread, is solved.
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