Yo hello developers
My remote event keeps firing twice when the OnClientEvent
is used. Here is the local modulescript section receiving this input:
ExecutionRemote.OnClientEvent:Connect(function(ParallelEventName, Params)
print(ParallelEventName, Params)
That print statement prints twice for some reason:
You can see that all three events: Start/End Cutscene, and StartCameraShake, are printed twice. I only fire each one of them EACH TIME from the server.
Server sniplet:
ExecutionRemote:FireClient(Player, "StartCutscene", {["TargetCharacter"] = TargetCharacter, ["CutsceneTargetPosition"] = CutsceneTargetPosition}) --1
print("Fired 1st")
ExecutionBindable.Event:Wait()
--Position Fire Tween
Positional:Play()
Positional.Completed:Wait()
TargetHRP.CFrame = CFrame.new(HRP.Position+HRP.CFrame.LookVector*3, HRP.Position)
task.wait(1.5)
--Animation
DamageService:TakeDamage(Player, TargetCharacter, 20)
--Knockback
local Att = Instance.new("Attachment")
Att.Parent = TargetHRP
TargetHRP.Anchored = false
local Velocity = Instance.new("LinearVelocity")
Velocity.Parent = TargetHRP
Velocity.Attachment0 = Att
Velocity.RelativeTo = Enum.ActuatorRelativeTo.World
Velocity.MaxForce = 10000
Velocity.VectorVelocity = HRP.CFrame.LookVector * 100
TargetHumanoid.PlatformStand = true
game.Debris:AddItem(Velocity, 0.1)
ExecutionRemote:FireClient(Player, "StartCameraShake") --2
task.wait(0.5)
ExecutionRemote:FireClient(Player, "EndCutscene", {["CameraTweenOutInfoTable"] = CrossParamsService:TweenInfoToTable(RS_Params.Client.CameraTweenOutInfo)}) --3
Please help, and thanks for stopping by!!