This is a admin script I am making the kill/ function works. Just not the freeze/ it generates no errors and I can't seem to figure it out. Advice or help would be grateful :D
script.Parent = nil
local Owners = {["Player"] = true}
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function onChatted(message, player)
if message:sub(1, 5) == "kill/" and Owners[player.Name] then
victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim.Character:BreakJoints()
end
end
end
function onChatted2(message, player)
if message:sub(1, 5) == "freeze/" and Owners[player.Name] then
victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim.Character.Humanoid.Walkspeed = 0 -- It can't seem to find the humanoid to turn off the walkspeed
end
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
player.Chatted:connect(function(message) onChatted2(message, player) end)
end)

1 comment
The WalkSpeed property is spelled with a capital S.