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

How do I fire the Client through a RemoteEvent?

So basically, I have a script in a part, but I don't know how to fire the client via a script using a RemoteEvent. Here's the Script in the Part

function onTouched(part)
   game.ReplicatedStorage.Coins.TYBPitks:FireClient()  
end

script.Parent.Touched:connect(onTouched)

Thanks in Advance — DindinYT37

1 answer

✓ Accepted answer

I'm assuming this is what you want. Put this block of code in a LocalScript and change the line below local function OnConnect() to what you prefer the function to do.

local Event = game.ReplicatedStorage.Coins.TYBPitks --Indexes placement of event
local function OnConnect() --When connected
	print("Connected!") --Action
end
Event.OnClientEvent:Connect(OnConnect) --Tell the function when to activate

Also, you might want to read up on Debounce as this script would cause several events to fire.

1 comment

0

If this helped, be sure to accept my question so others having the same problem can find a fix.

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