Jump to content

Can someone help me transform this script in a resource?


Daduuu

Recommended Posts

addEventHandler("onPlayerDamage", getRootElement(),

function(attacker, weapon, body, loss)

if not (attacker == source) then

local attackAccount = getPlayerAccount(attacker)

local sourceAccount = getPlayerAccount(source)

if not isGuestAccount(sourceAccount) then

if not isGuestAccount(attackAccount) then

setAccountData(attackAccount, "antideslog", false)

setTimer(function()

for i, v in ipairs(getElementsByType("player"))do -- check if the player still connected in the server

if v == attacker then

setAccountData(attackAccount, "antideslog", true)

-- The attacker is not in combat anymore after 1 min

end

end

end, 60000, 1)

end

setAccountData(sourceAccount, "antideslog", false)

setTimer(function()

for i, v in ipairs(getElementsByType("player"))do -- check if the player still connected in the server

if v == source then

setAccountData(sourceAccount, "antideslog", true)

-- The player who receive the shot is not in combat anymore after 1 min

end

end

end, 60000, 1)

end

-- They are now in combat.

end

end)

addEventHandler("onPlayerLogin", getRootElement(),

function(previous, current, autologin)

if current then

local data = getAccountData(current, "antideslog")

if (data == true) then

-- ok, he can play

elseif(data == false)then

-- ban the player

setAccountData(current, "antideslog", true)

banPlayer(source)

else

end

end

end)

This is a script for Anti Combat Relog and i need help transforming it in a resource if someone can make the script better it's ok :3 Please help me!

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