Ad
Log in to vote
0

Filtering Enabled Problems. Any help?

Asked by 4 months ago

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

0
Server scripts do not have a LocalPlayer, try adding a player value to the .OnServerEvent function and using it as the player index. Scarious 203 — 4mo
0
um I dont know how to do that :/ WillBe_Stoped 50 — 4mo

1 answer

Log in to vote
0
Answered by 4 months ago

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! ;)

0
are u sure its FE :/ WillBe_Stoped 50 — 4mo
0
Yes, I am! (I have 3 years of experience with scripting. ;D) marketmanager1 52 — 4mo
0
ok WillBe_Stoped 50 — 4mo
0
;) marketmanager1 52 — 4mo
Ad

Answer this question