Hello, I need help.
So in my server I try to code in if they have a certain ULX Rank then they get a health boost.
I have tried:
local ranks = { "superadmin", "admin", "vip" }
local boost = 10
function HealthBoost( ply )
if table.HasValue( ranks, ply:GetUserGroup() ) then
ply:SetMaxHealth( ply:Health() + boost )
ply:SetHealth( ply:Health() + boost )
end
end
hook.Add( "PlayerSpawn", "Health_Boost", HealthBoost )
------------------------------------------------------
hook.Add( "PlayerInitialSpawn", "SetHP", function(ply)
if ply:IsUserGroup("suerpadmin") then
ply:SetHealth(250)
end
end )
------------------------------------------------------
hook.Add( "PlayerInitialSpawn", "SetHP", function(ply)
if ply:IsUserGroup("suerpadmin") then
RunConsoleCommand("ulx", "hp" ..ply:Nick().. " 250")
end
end )
So I don't know what I need to do.
What folder did you put the script in?
I put it in lua/autorun and also in lua/autorun/server
Maybe it's not working because of
"suerpadmin"
RunConsoleCommand arguments are also wrong, read argument description carefully
I edited it and still did not work I used
hook.Add( "PlayerInitialSpawn", "SetHP", function(ply)
if ply:IsUserGroup("superadmin") then
ply:SetHealth(250)
end
end )
GM/PlayerSpawn - read the warning message, try to add a timer timer.Simple
Ayyy I got it working
Sorry, you need to Log In to post a reply to this thread.