Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Whats wrong with my script?

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

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

4 comments

0

how would i reach the players character?

0

just copy the script, i head to change

0

local Character = script.Parent.Parent to local Character = script.Parent.Parent.Character this should make it work

0

doesnt work

This discussion is preserved as it was. New answers, comments, and votes are closed.