I was making a god command for a friend’s scp game but whenever I test it, it’s just doesn’t change my health to math.huge or infinite if you prefer.
local config = require(game:GetService("ServerScriptService").ParalaxAdmin.Setup)
local godData = game:GetService("DataStoreService"):GetDataStore("god81SSQQFIJQDQVJDIOF")
local function GetPlayer(String)
for i,v in pairs(game.Players:GetPlayers()) do
if (string.sub(string.lower(v.Name), 1, string.len(String))) == string.lower(String) then
return v
end
end
end
local target
game.Players.PlayerAdded:Connect(function(plr)
wait(game:IsLoaded())
if plr:GetRankInGroup(config.GroupID) >= 4 then
plr.Chatted:Connect(function(msg)
local args = msg:split(" ")
if args[1] == ":god" then
if args[2] then
if args[2] == "me" then
target = plr
elseif args[2] == "admins" then
for i,v in pairs(game.Players:GetPlayers()) do
if v:GetRankInGroup(config.GroupID) >= 4 then
target = v
else
target = GetPlayer(args[2])
end
if args[3] then
if args[3] == true then
godData:SetAsync(target.UserId,true)
end
local humanoid = target.Character:FindFirstChild("Humanoid")
humanoid.MaxHealth = math.huge
humanoid.Health = math.huge
end
end
local humanoid = target.Character:FindFirstChild("Humanoid")
humanoid.Died:Connect(function(char)
if godData:GetAsync(target.UserId,true) then
humanoid.MaxHealth = math.huge
humanoid.Health = math.huge
end
end)
end
end
end
end)
end
end)