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

Could you use a local script to call on a regular script?

Asked by
IcyEvil 260 Moderation Voter
7 years ago

Is it possible to use a local script to call upon a regular script?

I am making a Holo Commands GUI, and as of current all it does is give a client sided map. I am needing it to be server sided like regular holo commands.

But doing that with only local scripts is virtually impossible, from my understanding of it. Which means I would need to be able to call on a Regular script, from a Local Script to make it work properly.

0
Do you mean Remote Events and Remote Functions? Sorry, I am not sure what it is you are asking for. RockerCaleb1234 282 — 7y

1 answer

Log in to vote
1
Answered by
VoltCode 101
7 years ago

**The answer is yes, thankfully. **

Where I got my information: http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions

To call upon a server script from a local script, it's quite simple (Assuming you want to use an event) :

-- This is placed inside the Local script


local Event = -- location of your remote event

Event:FireServer(You send information here) -- fires signal to server to execute whatever is in the event
-- This is placed inside the Server script


Event = -- location of your remote event


function FunctionNameHere(receives information here)
    -- does stuff with received information to specified player (with information you provided)
end

Event.OnServerEvent:Connect(FunctionNameHere) -- When called upon, runs FunctionNameHere
Ad

Answer this question