Help with FireClient()

Hello.
I have written a script involving a fireclient() function, and it is giving me an error.

Argument 1 missing or nil.

Here’s the script:


local proxprompt = game.Workspace.pppart.ProximityPrompt

local event = game.ReplicatedStorage:WaitForChild("levertocut1")

local lever = game.Workspace.Lever.LeverHandle

local lp = game.Workspace.Lever.LeverHandlepulled

local ts = game:GetService("TweenService")

local leversound = script.Parent.Parent.leversound

local tweeninfo = TweenInfo.new(

0.5,

Enum.EasingStyle.Sine,

Enum.EasingDirection.Out,

0,

false,

0

)

local tweeninfo2 = TweenInfo.new(

1,

Enum.EasingStyle.Sine,

Enum.EasingDirection.Out,

0,

false,

0

)

local tween = ts:Create(lever, tweeninfo, {CFrame = lp.CFrame})

local tween2 = ts:Create(game.Workspace.epart1, tweeninfo2, {CFrame = game.Workspace.epart1end.CFrame})

local tween3 = ts:Create(game.Workspace.epart2, tweeninfo2, {CFrame = game.Workspace.epart2end.CFrame})

proxprompt.Triggered:Connect(function()

leversound:Play()

proxprompt:Destroy()

event:FireClient()

wait(2)

tween:Play()

tween2:Play()

tween3:Play()

end)

If any of you scripting geniuses would take the time to help, I’d greatly appreciate it, as I’ve been looking for an answer for a while!

FireClient expects you to pass in a player to fire to, the Triggered event gives the player who triggered the prompt, so you can use that

proxprompt.Triggered:Connect(function(player)
event:FireClient(player)
2 Likes

Argument 1 is the player you’re firing it for

2 Likes

Okay, thanks for the replies, @EmbatTheHybrid and @Jexemie

I want it to fire a cutscene for all clients, and then I saw FireAllClients()
Used it, and it worked. Thanks for taking the time to reply.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.