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: I forgot a question in my last thread

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Feb 2014 02:16 PM
Q5. Knowing the way functions work, is it possible to make a script full of functions, and access them individually in different scripts?

Q6. Was answering that annoying

A1. Yes I know I started at 5, if you read my last thread you'd know why
Report Abuse
kinglan is not online. kinglan
Joined: 25 Mar 2010
Total Posts: 420
16 Feb 2014 02:57 PM
You can have as many functios as long as there in the flow of the script.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Feb 2014 03:16 PM
So if I made a script like

function kill(play)
game.Players.play:Destroy()
end


I can do this in another script

kill(warspyking)

???
Report Abuse
Gorake is not online. Gorake
Joined: 10 Feb 2014
Total Posts: 219
16 Feb 2014 03:18 PM
Well, no, at least not like that.

The simplest way to do it for you would be to use global functions, which CAN be accessed across-the-board by all scripts. You create them by putting _G. in front of the function name:

function _G.kill(player)
game.Players[player].Character:BreakJoints()
end


Then in another

_G.kill("warspyking")

There are other ways to do it as well, using modulescripts and remotebinded function, but this is the easiest.
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