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

Can someone help me change a players walkspeed on tool click?

Can someone please tell me how to make it so when someone clicks while holding a tool, it looks like they are eating it and it gives them +1 walkspeed?

2 comments

0

to change walkspeed you need to do: game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = (change to amout you want)

0

The question is asking how to increment WalkSpeed, not setting walkspeed. @sergeant_ranger

1 answer

This should be what you are looking for. Put this code as a LocalScript into a tool.

local Players = game:GetService("Players")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local Tool = script.Parent

Tool.Activated:Connect(function()
	if Humanoid then
		Humanoid.WalkSpeed = Humanoid.WalkSpeed + 1 -- increment WalkSpeed by 1
	end
end)

For the eating part, you'd have to animate the tool to have the character look like it's eating an apple.

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