idk what am I doing wrong, but anyways i want the script to change your walkspeed
script.Parent.ClickDetector.MouseClick:Connect(function(lol) local humanoid = lol.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then humanoid.WalkSpeed = 0 end end)
To check if the player has a humanoid you need to use an if statement correctly like i have done below
script.Parent.ClickDetector.MouseClick:Connect(function(player) local Character = workspace:WaitForChild(player.Name) if Character:FindFirstChild('Humanoid') then Character.Humanoid.WalkSpeed = 0 end end)