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

Filtering Enabled Problems. Any help?

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

0

Server scripts do not have a LocalPlayer, try adding a player value to the .OnServerEvent function and using it as the player index.

0

um I dont know how to do that :/

1 answer

✓ Accepted answer

Hey there! There is no need to make this script FE compatible! It already is! (If you script it right.)

--Put this in a "Script" inside the part that has to be touched.
local wsSetting = 50

Script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		hit.Parent.Humanoid.WalkSpeed = wsSetting
	end
end

If you need any more help, let me know! ;)

4 comments

0

are u sure its FE :/

0

Yes, I am! (I have 3 years of experience with scripting. ;D)

0

ok

0

;)

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