Argument 1, script requires help

Hi!
I’m making 2 scripts, the first script is in a proximity prompt in workspace which fires a event using FireClient. But when it fires the event (Event is named bucket) it gives me Argument 1 in the output, the SECOND SCRIPT which actually shows what the event does, is found below

THE ERROR ISNT IN THE FIRST SCRIPT, ITS IN THE LOCAL SCRIPT BELOW.

local PlayerGui = game.Players.LocalPlayer.PlayerGui
local player = game.Players.LocalPlayer
local ObjectiveText = PlayerGui.Objectives.Holder.Fade
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BucketEvent = ReplicatedStorage.Others:WaitForChild("Bucket")

BucketEvent.OnClientEvent:Connect(function()
ObjectiveText.TextLabel.Visible = false
ObjectiveText.BucketEvent.Visible = true
end)

It says there is a problem on line 9, line 9 is where it says ObjectiveText.TextLabel.Visible = false

any help is helpful.

Can we see the script that fires it, you most likely forgot to pass in the player

1 Like

put the whole objectveText variable inside the OnClientEvent

This is the script inside the proximity prompt

local Part = script.Parent.Parent
local ProximityPrompt = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")

ProximityPrompt.Triggered:connect(function(Player)
		workspace.Bucket:Destroy()
		script.Parent.Parent:Destroy()
		ReplicatedStorage.Others.Bucket:FireClient()
end)

Others is a folder inside replicated storage

Change to:
:FireClient(Player)
You have to pass in the Player when Firing The Client

2 Likes

Do FireClient(Player). You need to specify which client you are firing to or it won’t work. You can alternatively use FireAllClients(), if you wish to fire to every client without looping through Players.

3 Likes

Thanks, it works now, and yes am aware of FireAllClients. :+1:

1 Like