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

How to reference a script for spawnblocks ?

Asked by 5 years ago

For scripting i use c++ so i don't know anything about Lua.

Long story short i want to find out if i can reference another script in a script and how.

Scenario I am making an game which includes spawn points in the game. At the moment i have a leaderboard script set up within serverscriptservice and there is a variable named stage which is supposed to determine where you spawn. Supposedly, only way to change that variable is through contact with a spawnpoint block.

In order to do so i have to reference the script from elsewhere. And if there is a easier way to achieve this then that would be great to.

Thanks :)

1 answer

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

From what I can understand reading your question, you would want to use a modulescript. Others may suggest using _G, however, I (along with many other people) will recommend against it due to various reasons which can be explained here. (BlueTaslem's answer.)

On second thought, you could actually just use your leaderboard script and not have to reference anything. Just loop through all the spawn points and if a player touches any of them, change the variable.

0
How would i write if player makes contact with the spawnblock, would i put the script on the player and then .parent it? Gamerzhi 4 — 5y
Ad

Answer this question