Karuzo Posted January 30, 2014 Share Posted January 30, 2014 Hey Guys, i have a problem. I have a script which gives people who are downloading Godmode. So, my problem is , they don't get godmode ._. Client.lua : addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) Server.lua function checkTransfer() if isTransferBoxActive() == true then setTimer(checkTransfer,2000,1) setElementData(localPlayer,"invincible",true) outputChatBox("Download ediorsun, sana Godmode verildi!!",0,255,0) else setElementData(localPlayer,"invincible",false) outputChatBox("Download bitti, Godmodun alindi!",0,255,0) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer) addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) outputChatBox( "Script by Porno: " .. getResourceName( startedRes ) ); end ); Link to comment
pa3ck Posted January 30, 2014 Share Posted January 30, 2014 Try this: Client: timer = setTimer(function() if isTransferBoxActive() == false then -- Download finished if isTimer(timer) then -- Kill the timer killTimer(timer) setElementData(localPlayer, "downloaded", 1) end else if getElementData(localPlayer, 'downloaded') ~= 0 then -- He is still downloading setElementData(localPlayer, 'downloaded', 0) end end end, 1000, 0) addEventHandler("onClientPlayerDamage", root, function() if getElementData(source, "downloaded") ~= 1 then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",root, function () if getElementData(source,"downloaded") ~= 1 then cancelEvent() end end) 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