the script is supposed to change the characters walk speed when they touch a part. When I touch the part, it doesn’t work, and my walk speed doesn’t update.
This won’t affect the players, you have to to it to the characters humanoid not the StarterPlayer
Put this script inside the Lentilkac58-Easy-Teleport-1 part
script.Parent.Touched:Connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
human.WalkSpeed = 8
human.JumpPower = 3
end
end)
So you should add this line after changing values. Anyways it’s better using the script above my post.
if game.Players:GetPlayerFromCharacter(hit.Parent) then -- Is a player.
local Humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
Humanoid.JumpPower = game.StarterPlayer.JumpPower
end
How do I increase the speed when the part is touched then?
game.StarterPlayer.CharacterJumpPower = 0
game.StarterPlayer.CharacterWalkSpeed = 4
game.Workspace.twlw["Lentilkac58-Easy-Teleport-1"].Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then -- Is a player.
local Humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
Humanoid.JumpPower = game.StarterPlayer.CharacterJumpPower
end
end)