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: Script help?

Previous Thread :: Next Thread 
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 01:47 AM
player = script.Parent.Parent.Parent.Parent
codeItem = game.ReplicatedStorage.Item1
codeBox = script.Parent
function code()
if codeBox.Text == "code1" then
local a = codeItem:clone()
a.Parent = player.Backpack

end
end
What's wrong with it?
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 02:07 AM
b
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
01 Oct 2014 02:16 AM
you never call code()
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 02:17 AM
How do I call it?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
01 Oct 2014 02:17 AM
code()
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 02:21 AM
Not helping!
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
01 Oct 2014 02:22 AM
'Course it is. That's how you call code(), numnuts
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 02:22 AM
How do I put it into the script?
Report Abuse
ZeroSpectrum is not online. ZeroSpectrum
Joined: 02 Mar 2011
Total Posts: 315
01 Oct 2014 03:35 AM
In order for a function to run, it must be called.

player = script.Parent.Parent.Parent.Parent
codeItem = game.ReplicatedStorage.Item1
codeBox = script.Parent
function code()
if codeBox.Text == "code1" then
local a = codeItem:clone()
a.Parent = player.Backpack
end
end

code() --put this anywhere in your script to run the "code" function.
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 11:08 AM
Still wont work!
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
01 Oct 2014 12:23 PM
b
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
02 Oct 2014 02:14 AM
b
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Oct 2014 02:30 AM
Learn to Lua - knowing how to call a function is a very important part of any language, and a core part of anything you should be learning.
Report Abuse
coolcoolkidcheseey45 is not online. coolcoolkidcheseey45
Joined: 22 Feb 2009
Total Posts: 5668
02 Oct 2014 03:28 AM
I'm a beginner, and none of the experts called it out, but I think you need to connect the function in order for it to work?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
02 Oct 2014 05:13 AM
You don't need to connect to an event to call a 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