I'm making a survival game and I need to get it so when you chop down a tree you gain specific resources. I have everything done, except what you're supposed to fire it to. I need the event to fire the Client from the Server but don't know what to put in the parenthesis after "event:FireClient(?)". What do I need to do? I try things like "Player", or "Touched.Parent" or "Player.Name" but then it gives me any of these errors: "Unable to cast value to object", or "Argument must be a player object". Please help me :/
event:FireClient(parameters)
You will need to make LocalScript and insert function event.OnClientEvent(parameters)
Parameters: you can use LocalPlayer or any parameter, but you will need to do the same for ServerScript. For example:
ServerScript:
-- The code I gave you in previous question or use your own event:FireClient(player) -- You must connect to a function and insert event:FireClient() into the function. Make sure you add player if possible in the function as a parameter.
LocalScript:
-- Also use same code function onClientEvent(player) -- do stuff end event.OnClientEvent:Connect(onClientEvent)
That was one example. You can search up RemoteEvent:FireClient()
on Google and read more about it. Hope this helps!