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

How can i get a Speed Coil to work with Filtering Enabled?

Asked by
Kulh 125
7 years ago
Edited 7 years ago

I've been trying to do this ever since i woke up. Every attempt i make fails when i test it with a server. I've had small successes with the Client, but not Server

If it works with Server test i will accept the help of you.

--Local Script

local tool = script.Parent
local speedEvent = tool.SpeedEvent
local humanoid = game.Players.LocalPlayer.Character.Humanoid

local function onActivated()
speedEvent:FireServer(humanoid)
end

speedEvent.OnClientEvent:connect(function(arg)--Listener of FireClient(),just an example.
    print(arg)

end)


tool.Activated:Connect(onActivated)
-- Server Script

local tool = script.Parent

local speedEvent = tool.SpeedEvent

local function onSpeedEventFired(player, arg)
    if arg and arg.Name == "Humanoid" and not arg.WalkSpeed == 32 then
        tool.Handle.CoilSound:Play()        
        arg.WalkSpeed = 32
    end
end

speedEvent.OnServerEvent:Connect(onSpeedEventFired)

Both scripts including RemoteEvent are in the Tool

0
With credit to you in the gamepass. Kulh 125 — 7y
0
Scripts do not run in the client, only LocalScripts. Mineloxer 187 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

The server script did not fire back to the client.

Ad

Answer this question