Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

01dog = false
02local rep = game.ReplicatedStorage
03 
04script.Parent.MouseButton1Click:connect(function()
05local player = script.Parent.Parent.Parent.Parent.Parent
06if player.hats.Money.Value == 0 then
07    print("Button1 Clicked")
08dog = true
09player.banking.Cash.Value = player.banking.Cash.Value - 80
10player.hats.Money.Value = 1
11player.hats.Money2.Value = 0
12player.hats.Money3.Value = 0
13player.hats.Money4.Value = 0
14player.hats.Money5.Value = 0
15player.hats.Money6.Value = 0
View all 52 lines...

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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

0
Im confused? Go deeper. Pooglies 7 — 5y
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 Thesquid13 301 — 5y
0
Iv done that and its still not working. Pooglies 7 — 5y
Ad
Log in to vote
0
Answered by
Asentis 17
5 years ago

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

Answer this question