Argument 1 missing or nil "Probably very begginer question"

Sorry for bad english, I was making very simple fishing system that if someone activated proximity prompt, Then get fish with some chance and disable proximity prompt to the one who activated, But this error appeared on my outputs.

“Argument 1 missing or nil
Stack Begin
Script ‘Workspace.PistachioRiver.ProximityPrompt.Script’, Line 10
Stack End”

Script

local detector = script.Parent
local event = game.ReplicatedStorage.Temp.PromptDisableLol

detector.Triggered:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local findtool = character:FindFirstChild("Fishing Rod")
	if findtool then
		local choose = math.random(1, 150)
		if choose <= 80 then
			event:FireClient()
			local a = game.Lighting.Fish["Pistachio River"]["Rainbow Trout"]:Clone()
			a.Parent = player.Backpack
		end
	end
end)

LocalScript

local event = game.ReplicatedStorage.Temp:WaitForChild("PromptDisableLol")

event.OnClientEvent:Connect(function()
	local plr = game.Players.LocalPlayer
	local char = plr.Character or plr.CharacterAdded:Wait()
	script.Parent.Enabled = false
end)

The first argument in :FireClient() needs to be the player you want to fire the event to.
Replace:

with:

event:FireClient(player)
1 Like

You must specify the player who you want to fire the said event to or it will fail to work.