Hi. Im trying to make a script where if you touch a part it changes your Walkspeed to 50. (FE)
local Remote = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvents").WalkSpeed
local players = game:GetService("Players")
function addPlayer(player)
Remote:FireServer()
end
for _,player in pairs(players:GetPlayers())do
addPlayer(player)
end
players.PlayerAdded:connect(addPlayer)
thats the thing to fire the remotevent
game.ReplicatedStorage.RemoteEvents.WalkSpeed.OnServerEvent:Connect(function()
workspace.Run.Touched:Connect(function()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 50
end)
end)
Thats where you actually touch the part

2 comments
Server scripts do not have a LocalPlayer, try adding a player value to the .OnServerEvent function and using it as the player index.
um I dont know how to do that :/