swag_k_dog Posted October 10, 2016 Posted October 10, 2016 (edited) I wanted to script a ped, and negate the damage he takes, but I got it wrong.. server: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() local batped = createPed(30, 2767.5, -1617, 11) setElementRotation(batped, 0, 0, -45) setTimer(setPedAnimation,500,1,batped, "dildo", "dildo_idle") setTimer(giveWeapon,500,1,batped, 5, 1, true) triggerClientEvent("onClientPedDamage", resourceRoot) end ) and client: addEvent("onClientPedDamage", true) addEventHandler("onClientPedDamage", getRootElement(), function() cancelEvent() end ) whats the problem? Edited October 10, 2016 by swag_k_dog
Walid Posted October 10, 2016 Posted October 10, 2016 use this client side addEventHandler("onClientResourceStart", resourceRoot, function() batped = createPed(30, 2767.5, -1617, 11) setElementRotation(batped, 0, 0, -45) setTimer(setPedAnimation,500,1,batped, "dildo", "dildo_idle") setTimer(givePedWeapon,500,1,batped, 5, 1, true) addEventHandler ( "onClientPedDamage", batped, cancelPedDamage) end ) function cancelPedDamage () if source == batped then cancelEvent() end end 1 Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
swag_k_dog Posted October 10, 2016 Author Posted October 10, 2016 1 minute ago, Walid said: use this client side addEventHandler("onClientResourceStart", resourceRoot, function() batped = createPed(30, 2767.5, -1617, 11) setElementRotation(batped, 0, 0, -45) setTimer(setPedAnimation,500,1,batped, "dildo", "dildo_idle") setTimer(givePedWeapon,500,1,batped, 5, 1, true) addEventHandler ( "onClientPedDamage", batped, cancelPedDamage) end ) function cancelPedDamage () if source == batped then cancelEvent() end end Thanks for all the help. you're always here when I need you damn, scripting is getting more interesting now
Walid Posted October 10, 2016 Posted October 10, 2016 1 minute ago, swag_k_dog said: Thanks for all the help. you're always here when I need you damn, scripting is getting more interesting now np Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Gravestone Posted October 11, 2016 Posted October 11, 2016 Btw, onClientPedDamage is a MTA's event so you don't have to add it. 1 Clan war system http://sh.st/7r4nI
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