local part = Instance.new('Part', Workspace)
part.Anchored = true
part.Transparency = .5
part.BrickColor = BrickColor.new('Bright red')
part.Touched:connect(function()
game.Workspace.Player1.Humanoid.WalkSpeed = 200
end)
What i specifically mean is that when anyone touches that bright red brick that is created into the workspace, how do I make it that when 'anyone' touches it, their speed turns to 200?
game.Workspace.Player1.Humanoid.WalkSpeed=200
I am sure that is the line I have to change, but I am not sure what to change it too to make sure that when 'anyone' touches it, there speed is made 200.
Insert this script into your brick.
function onTouched(hit) local h = hit.Parent:findFirstChild("Humanoid") if h == nil then return end if h ~= nil then h.WalkSpeed = 200 end end
local part = Instance.new("Part", Workspace) part.Anchored = true part.Transparency = 0.5 part.BrickColor = BrickColor.new("Bright red") function touched(p) -- p is the part that touched the Part if p.Parent:FindFirstChild("Humanoid") ~= nil then -- check to make sure its a character p.Parent.Humanoid.Walkspeed = 200 end end part.Touched:connect(touched)