Im getting an Arguement 1 missing or nil error on line 21 of my script. Any help here?
01 | dog = false |
02 | local rep = game.ReplicatedStorage |
03 |
04 | script.Parent.MouseButton 1 Click:connect( function () |
05 | local player = script.Parent.Parent.Parent.Parent.Parent |
06 | if player.hats.Money.Value = = 0 then |
07 | print ( "Button1 Clicked" ) |
08 | dog = true |
09 | player.banking.Cash.Value = player.banking.Cash.Value - 80 |
10 | player.hats.Money.Value = 1 |
11 | player.hats.Money 2. Value = 0 |
12 | player.hats.Money 3. Value = 0 |
13 | player.hats.Money 4. Value = 0 |
14 | player.hats.Money 5. Value = 0 |
15 | player.hats.Money 6. Value = 0 |
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