Jump to content

Give Downloading Players Godmode


Karuzo

Recommended Posts

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

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

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...