conradotd
(conradotd)
September 30, 2020, 12:39pm
#1
today i tried to make a inventory gui and it worked, after that i tried to make a collect item system but for some reason everytime i launch play, the collect button on the item doesnt show up and it shows this error in the console ‘‘attempt to index nil with ‘OnClientEvent’’’
this is the script that is giving errors:
client.OnClientEvent:Connect(function(material)
button.Visible = true
i tried my best to fix it but im not being capable of
Aorda
(Arda)
September 30, 2020, 12:40pm
#2
If it is a local script, you should use “OnServerEvent” as the server fires the event.
conradotd
(conradotd)
September 30, 2020, 12:41pm
#3
Aorda:
OnServerEvent
so i should change OnClientEvent to OnServerEvent?
hakobmher
(Hak)
September 30, 2020, 12:41pm
#4
Depends on what is your script its local script or server script
Aorda
(Arda)
September 30, 2020, 12:41pm
#5
The object named “client” may not be a remote event. Double check if it is.
The error is saying that the variable client
is nil. Can you show us what this variable is assigned to?
Nerbzzz
(Nikki)
September 30, 2020, 12:45pm
#7
If this is a localscript
Then in the script you should put
Event:FireClient(PlayerToSendThingTo)
1 Like