here’s my script:
local part = game.Workspace.Part
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local h = char.Humanoid
function onurmom()
h.WalkSpeed = 100
else
h.WalkSpeed = 16
end
part.MouseButton1Click:Connect(onurmom)
WooleyWool
(AWildWooleyWool)
January 27, 2022, 5:53pm
#2
You’ll need to add a Clickdetector to the part. Then do part.ClickDetector.MouseClicked.
1 Like
what about the else part incase walk speed is already 100
koyugaki
(kenn)
January 27, 2022, 5:56pm
#4
What is the “else” checking? I don’t see an if statement.
1 Like
WooleyWool
(AWildWooleyWool)
January 27, 2022, 5:57pm
#5
This is what you do in that case:
part.ClickDetector.MouseClicked:Connect(function(player)
if player.Character.Humanoid.WalkSpeed == 100 then
player.Character.Humanoid.WalkSpeed = 16
else
player.Character.Humanoid.WalkSpeed = 100
end
end)
1 Like
ohh ok thank you for help you too keneyaz