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)
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
You're possibly using :FireClient() within a local script. Instead of :FireClient(), use :FireServer() as local scripts can't use :FireClient(), only regular scripts can.
Read more about this here: https://developer.roblox.com/api-reference/class/RemoteEvent