|
| 31 Jan 2017 02:57 PM |
would the script apply for all scripts? for example the script is a variables script..
here it is:
--Variables function Variables function variablesKartNames Hoverkart = game.workspace.HoverKart Classickart = game.workspace.ClassicKart SpeedyRacer = game.workspace.SpeedyRacer BattleRam = game.workspace.BattleRam MonsterKart = game.workspace.MonsterKart GlassAssasin = game.workspace.Glassassasin end
function variablesKartAbility Fly = game.workspace.HoverKart.Ability end end
-Your Fellow Scripter, |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 31 Jan 2017 02:58 PM |
No, if you want to share code across several scripts you need to use the global table, _G, or module scripts.
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 02:58 PM |
| That's not how you declare variables. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:00 PM |
| I think, yes except the fly one. Go on check it out, Im not soo good at scripting. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:00 PM |
well thanks for replying, but that wasnt what I was asking, But either way if that is not please give me an example of how I declare variables
-Your Fellow Scripter, |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:01 PM |
thanks!
-Your Fellow Scripter, |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:01 PM |
| No, i just found out. it wont work. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:02 PM |
oh, well im not 100% good with scripting as I am starting out, I appreciate all of your replies!
-Your Fellow Scripter, |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:02 PM |
| If you need help, go and search roblox wiki, its really helpful... if you didnt know about it. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2017 03:03 PM |
| Write the variables at the top of each script. Please. |
|
|
| Report Abuse |
|
|