Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats wrong with my script?

Asked by
ned995 0
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
local Tool = script.Parent
local Character = script.Parent.Parent
local Humanoid = Character.Humanoid
local Walkspeed = Humanoid.Walkspeed

if (Tool.Enabled == true)
    then return true
end

if (Tool.Enabled == false)
    then return false
end

if (Tool.Enabled == true)
    then Walkspeed = 30
end

1 answer

Log in to vote
-1
Answered by 10 years ago
local Tool = script.Parent
local Character = script.Parent.Parent.Character
local Humanoid = Character.Humanoid -- you need to reach the players character before being able to change humandoid stats.
local Walkspeed = Humanoid.Walkspeed 

if (Tool.Enabled == true)
    then return true
end

if (Tool.Enabled == false)
    then return false
end

if (Tool.Enabled == true)
    then Walkspeed = 30
end
0
how would i reach the players character? ned995 0 — 10y
0
just copy the script, i head to change raymandon 0 — 10y
0
local Character = script.Parent.Parent to local Character = script.Parent.Parent.Character this should make it work raymandon 0 — 10y
0
doesnt work ned995 0 — 10y
Ad

Answer this question