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
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.