Parazitas Posted August 22, 2016 Share Posted August 22, 2016 Hello guys! Im learning how to script, i have this function and i want edit ( When player have skin 45 he cant can't kill other players and others cant kill him.. maybe can help me? function enterWaterfish () local playerTeam = getPlayerTeam ( source ) local TeamName = getTeamName ( playerTeam ) if TeamName == "team" then if isElementInWater(source) then setElementHealth ( source, 100 ) end end end addEventHandler ( "onPlayerDamage", getRootElement (), enterWaterfish ) Link to comment
roaddog Posted August 22, 2016 Share Posted August 22, 2016 This is client side script function stopDamage ( attacker ) local skin = getElementModel(source) local attskin = getElementModel(attacker) if ( skin == 45 or attskin == 45 ) then cancelEvent() --cancel if damaged plr or att has the skin end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) Link to comment
Parazitas Posted August 22, 2016 Author Share Posted August 22, 2016 Thanks!! one more thing.. imposible to make script: player who have skin 45 have unlimited ammo of weapon 41 or something like that? Link to comment
Gordon_G Posted August 23, 2016 Share Posted August 23, 2016 Yes, it's possible ! -- Server function onElementModelChange () if getElementModel(source) == 45 then giveWeapon(source,42,10000000, true) end end addEventHandler("onElementModelChange", root,onElementModelChange) Something like that ... 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