Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Im getting an Arguement 1 missing or nil error? any help with this issue?

Im getting an Arguement 1 missing or nil error on line 21 of my script. Any help here?

dog = false
local rep = game.ReplicatedStorage

script.Parent.MouseButton1Click:connect(function()
local player = script.Parent.Parent.Parent.Parent.Parent
if player.hats.Money.Value == 0 then
	print("Button1 Clicked")
dog = true
player.banking.Cash.Value = player.banking.Cash.Value - 80
player.hats.Money.Value = 1
player.hats.Money2.Value = 0
player.hats.Money3.Value = 0
player.hats.Money4.Value = 0
player.hats.Money5.Value = 0
player.hats.Money6.Value = 0
player.hats.Money18.Value = 0
player.hats.Money19.Value = 0
player.hats.Money20.Value = 0
		else
if player.hats.Money.Value == 1 then
rep:WaitForChild("Error"):FireClient()
end
local character = player.Character

local d = character:GetChildren() 
	for i=1, #d do 
		if (d[i].className == "Accessory") then 
			d[i]:remove() 
		end 
	end

	if character:findFirstChild("Humanoid") ~= nil then
		h = Instance.new("Accessory")
		p = Instance.new("Part")
		h.Name = "Hat"  
		p.Parent = h
		p.Position = character:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(-0,-0,-1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = character
		print("SUCCESS")
		h.AttachmentPos = Vector3.new(0, -0.20, 0) 
		wait(.1)
		dog = false
		end
	end
end)

2 answers

Using fireclient requires you to have a client object inside the parameter. Tell it what client it should be firing it to. You need to put a client object in there such as a name.

I suggest checking this out https://developer.roblox.com/api-reference/function/RemoteEvent/FireClient

4 comments

0

Im confused? Go deeper.

0

So, you wanna fire this to a client. Inside the () you put a player object. Such as the name. Without that info, it can't know which client to send it to

0

Iv done that and its still not working.

This discussion is preserved as it was. New answers, comments, and votes are closed.