local plr = game.Players.LocalPlayer local char = plr.Character local humanoid = char:FindFirstChild("Humanoid") local speed = script.Parent.SpeedValue script.Parent.Touched:Connect(function() humanoid.WalkSpeed = speed.Value end)
put this in a script in ServerScriptService
game.Workspace.Part.Touched:Connect(function(hit) --specify ur part if game.Players:GetPlayerFromCharacter(hit.Parent) then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) plr.Character:FindFirstChild("Humanoid").WalkSpeed = 50 --speed inside of the area end end) game.Workspace.Part.TouchEnded:Connect(function(hit) --specify the part if game.Players:GetPlayerFromCharacter(hit.Parent) then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) plr.Character:FindFirstChild("Humanoid").WalkSpeed = 16 -- speed exiting the area end end)
Try using region3 and constantly checking if the player is in the region3. If they are, then set their walkspeed. Let me know if it works!
You are using a localscript to change a players walkspeed. Either that or you're using a LocalPlayer
in a normal script. You can get a player's character by doing this
local speed = script.SpeedValue --Put the speedvalue inside the script script.Parent.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then humanoid.Walkspeed = speed.Value end end)
Let me know if this works!