Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fire the Client through a RemoteEvent?

Asked by 4 years ago
Edited 1 year ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
If this helped, be sure to accept my question so others having the same problem can find a fix. jensar141215 157 — 4y
Ad

Answer this question