Jump to content

COMMAND NOT TO SHOOT


zRiaan

Recommended Posts

-- CLIENT --

addEventHandler("onClientPlayerDamage",root,
function()
  if getElementData(source,"godmode") then
    cancelEvent()
  end
end
)

addEventHandler("onClientPlayerStealthKill",localPlayer,
function(player)
  if getElementData(player,"godmode") then
    cancelEvent()
  end
end
)
-- SERVER --

addCommandHandler("godmode",
function(player)
  if not getElementData(player,"godmode") then
    setElementData(player,"godmode",true)
    outputChatBox("Godmode: #00FF00enabled",player,255,255,255,true)
  else
    setElementData(player,"godmode",false)
    outputChatBox("Godmode: #FF0000disabled",player,255,255,255,true)
  end
end
)
-- META --

<meta>
  <script src="client.lua" type="client" />
  <script src="server.lua" type="server" />
</meta>

 

Edited by ÆBKV
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...