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

How can I send a Server script to work on a client server?

I don't under stand how i could get a server script and get it to work in a client server. Can anyone give me a little bit more information on this?

1 comment

0

can you rephrase this question

1 answer

✓ Accepted answer

Note: Could you try to rephrase your question? My answer is based on what I believe you're trying to say.

Anyways, from what I'm interpreting, you are wondering how to get a ServerScript's features (i.e Functions, Statements, etc.) to show to the clients. With this, you can use RemoteEvents to display information from the Server to the Client. Here's a little example: Main Script

if 1 + 1  == 2 then
game.ReplicatedStorage.RemoteEvent:FireAllClients()
end

LocalScript

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
	print("hi!")
end)

What I did was comunicate to all the clients by firing the RemoteEvent. Upon firing, the clients receive the message, and end up printing "hi!" into the Client's output. You could also replace this with FireClient(). Hopefully this helps, and I'm sorry if I misunderstood your question!

2 comments

0

One more thing, do i need to put the FireAllClients/FireClient in a function?

0

It's not required but, you can if you want the script to play at a certain event or so.

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