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

how do you make a local script in a tool activate a server script in serverscriptservice?

Asked by 7 years ago

I have a localscript in my tool that is supposed to activate a server script but I feel like I need to make the server script local or something...can somebody explain how to make a script for filtering enabled games and tell me the differences between how I should script it and where? and can variables from the local script be read by the server script?

0
I think you're able to use normal scripts in a tool. Have you attempted that? Also, nice username. Mayk728 855 — 7y
0
lol thanks and i will try that TheBishNextDoor -10 — 7y
0
"server script local", so your saying that you can make a local script server? hiimgoodpack 2009 — 7y
0
You can have localscripts and regular scripts inside a tool. To have them interact with each other, use remotes. CootKitty 311 — 7y
0
Use RemoteEvents and RemoteFunctions. nanaluk01 247 — 7y

1 answer

Log in to vote
0
Answered by
Viking359 161
7 years ago

You need to use remote events. Remote events are used for communication between the client and the server, and FE doesn't affect them. If you post your current scripts I can help you more. Here's an example of how you would make a local script activate a server script with a local script.

--local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event= ReplicatedStorage:WaitForChild("RemoteEvent")

Event:FireServer()
--server script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event= Instance.new("RemoteEvent", ReplicatedStorage)
Event.Name = "Event"

local function EventFired()
--whatever it is here
end

Event.OnServerEvent:Connect(EventFired)

Go here for information on remote events. Variables can't be read, but you can create values(like string or int values) or put parameters in the firing.

0
Thank you so much! User#18979 5 — 7y
Ad

Answer this question