Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Filtering Enabled Problems. Any help?

Asked by 5 years 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 243 — 5y
0
um I dont know how to do that :/ WillBe_Stoped 71 — 5y

1 answer

Log in to vote
0
Answered by 5 years 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 71 — 5y
0
Yes, I am! (I have 3 years of experience with scripting. ;D) marketmanager1 52 — 5y
0
ok WillBe_Stoped 71 — 5y
0
;) marketmanager1 52 — 5y
Ad

Answer this question