Hey, I am making custom admin commands and already made 3, TP, Kill, and FF. I keep getting an error.
Error: ServerScriptService.CustomAdmin:2: attempt to compare number <= string
When I remove >= 5 it works, so I don’t really understand.
Script:
if player:GetRoleInGroup(11359577) >= 5 then
player.Chatted:Connect(function(message)
local split = message:split(" ")
if split[1] == ":kill" then
local name = split[2]
local playerName = game.Players:FindFirstChild(name)
if playerName then
playerName.Character.Humanoid.Health = 0
else
warn(name.." Isn't in game!")
end
end
end)
end
end)
game.Players.PlayerAdded:Connect(function(player)
if player:GetRoleInGroup(11359577) >= 5 then
player.Chatted:Connect(function(message)
local split = message:split(" ")
local name = split[2]
local playerName = game.Players:FindFirstChild(name)
if split[1] == ":ff" then
local ff = Instance.new("ForceField")
if playerName then
ff.Parent = playerName.Character
else
warn(name.."Isn't in game!")
ff:Destroy()
end
elseif split[1] == ":unff" then
if playerName then
local ff = playerName.Character.ForceField
if ff then
ff:Destroy()
else
return error("No FF")
end
else
warn("No Player")
end
end
end)
end
end)
game.Players.PlayerAdded:Connect(function(player)
if player:GetRoleInGroup(11359577) >= 5 then
player.Chatted:Connect(function(message)
local split = message:split(" ")
local name = split[2]
local playerName = game.Players:FindFirstChild(name)
if split[1] == ":tp" then
local name = split[2]
local playerName = game.Players:FindFirstChild(name)
if playerName then
player.Character.HumanoidRootPart.CFrame = playerName.Character.HumanoidRootPart.CFrame
end
end
end)
end
end)