generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Could we run a function in one script from another?

Previous Thread :: Next Thread 
evandro61536 is not online. evandro61536
Joined: 26 Dec 2010
Total Posts: 3142
05 Sep 2014 10:59 PM
like for example, if you do something simple like

function random()
game.Workspace.BasePlate.Transparency = 0.5
end

And then in the next script you could right like

game.Workspace.Script.random()

What do we write to make a function run if you want to do it in another script to run it, can we? (I am new to scripting)
Report Abuse
evandro61536 is not online. evandro61536
Joined: 26 Dec 2010
Total Posts: 3142
05 Sep 2014 11:02 PM
bump

i really need help on this
Report Abuse
evandro61536 is not online. evandro61536
Joined: 26 Dec 2010
Total Posts: 3142
05 Sep 2014 11:05 PM
BUMP
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
05 Sep 2014 11:33 PM
yes

global functions

1st script--


_G["printf"] = function(text) -- creates the global function
print(text)
end


2nd script --

_G["printf"]("Hello World!") -- runs a global function

Report Abuse
markedmoderator is not online. markedmoderator
Joined: 10 Jun 2010
Total Posts: 249
06 Sep 2014 12:18 AM
Yes,

shared.function ExampleName (ExampleArgument)
example code
end


You can do this with variables as well shared. means any scrip can access it

BUT YOU ALWAYS HAVE TO PUT .shared BEFORE EVEN WHEN ACCESSING IT NOT JUST DECLARING
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
06 Sep 2014 01:16 AM
y u no bindable/remote functions u n00bs.
Report Abuse
evandro61536 is not online. evandro61536
Joined: 26 Dec 2010
Total Posts: 3142
06 Sep 2014 10:53 AM
thanks for the help guys!
Report Abuse
evandro61536 is not online. evandro61536
Joined: 26 Dec 2010
Total Posts: 3142
06 Sep 2014 10:58 AM
didn't work, give me an example of the next code that runs the function.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image