Plr = game.Players.LocalPlayer
humanoid = Plr.Character.Humanoid.WalkSpeed
Tool = script.Parent
Tool.Activated:connect(function(mouse)
humanoid = 100
end)
None of the tool functions work at all, am I over thinking this?
Plr = game.Players.LocalPlayer
humanoid = Plr.Character.Humanoid.WalkSpeed
Tool = script.Parent
Tool.Activated:connect(function(mouse)
humanoid = 100
end)
None of the tool functions work at all, am I over thinking this?
the "game.player" and the character are not created the same time
Plr = game.Players.LocalPlayer
char = Plr.Character
Tool = script.Parent
repeat wait() until char:FindFirstChild("Humanoid");
humanoid = char.Humanoid
Tool.Activated:connect(function(mouse)
humanoid.WalkSpeed = 100
end)
The activated event doesn't take nor return anything. Also WalkSpeed isn't a object, but an integer so the variable humanoid is just whatever the characters current WalkSpeed is.
--LocalScript
local ply = game.Players.LocalPlayer
local cha = ply.Character
local hum = cha:WaitForChild("Humanoid")
script.Parent.Activated:connect(function()
hum.WalkSpeed = 100
end)
If you need to see what parameters an event or function takes or object they return then just go to the View tab in Studio and select ObjectBrowser then search whichever class the function or event is in.
Still refuses to work :/
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Looks like a basic mistake; redefine humanoid in line 2 to humanoid = Plr.Character.Humanoid, then in line 6 change to humanoid.WalkSpeed = 100. Your mistake was changing the variable representation of humanoid and not changing the walkspeed of the actual humanoid.