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

How do you run a script with another script?

Asked by 9 years ago

Lets say we have script B which is print('Loaded') and script A which is game.Workspace.B:Clone() Cloning the script wouldn't run the script, so how would you run it?

1 answer

Log in to vote
1
Answered by
Discern 1007 Moderation Voter
9 years ago

You have to give the script a parent for it to run.

Fixed Code:

--This should go in script A.

scriptClone = game.Workspace.B:Clone() --Sets a variable for the cloned script.
scriptClone.Parent = game.Workspace --Parent the cloned script so it will run in the game.

If I helped you out, be sure to accept my answer! :D

0
He could also consider using coroutines. drahsid5 250 — 9y
0
Or Bindables. Redbullusa 1580 — 9y
Ad

Answer this question