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.

01--Local Script
02 
03local tool = script.Parent
04local speedEvent = tool.SpeedEvent
05local humanoid = game.Players.LocalPlayer.Character.Humanoid
06 
07local function onActivated()
08speedEvent:FireServer(humanoid)
09end
10 
11speedEvent.OnClientEvent:connect(function(arg)--Listener of FireClient(),just an example.
12    print(arg)
13 
14end)
15 
16 
17tool.Activated:Connect(onActivated)
01-- Server Script
02 
03local tool = script.Parent
04 
05local speedEvent = tool.SpeedEvent
06 
07local function onSpeedEventFired(player, arg)
08    if arg and arg.Name == "Humanoid" and not arg.WalkSpeed == 32 then
09        tool.Handle.CoilSound:Play()       
10        arg.WalkSpeed = 32
11    end
12end
13 
14speedEvent.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