Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to fireclient from object to player with a parameter?

Im trying to make it where if a player clicks on an object, it will fireclient to the player along with a parameter but i cant figure out how to do it or pick it up in the players local script. I know how to do it the opposite way but nowhere online does it give the exact code.

1 answer

Read up on this tutorial.

Server -> Client

Event:FireClient(Player, Object) -- Player is a required first argument, anything else is optional
---- Below is receiving an event on the client. Client Script
Event.OnClientEvent:Connect(function(Object)
	print(Object.Name)
end)

Client -> Server

Event:FireServer(Object)

-- Below is receiving an event on the server. Server Script

Event.OnServerEvent:Connect(function(Player, Object) -- Player is required if you're using additional arguments
	print(Object.Name)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.