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
 

loadstring() not using variables?

Previous Thread :: Next Thread 
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
18 Aug 2012 06:14 PM
Commands = {
Hint = {
Command = {"Hint"},
Admin = true,
OAdmin = true,
Players = false,
Action = [[
local Hint = Instance.new("Hint",Workspace)
game.Debris:AddItem(Hint,10)
Hint.Text=tostring(Player)
]]}}
Command = Hint
local Player = game.Players["1Topcop"]
loadstring(Command.Action)()

No output.
Report Abuse
livinarock is not online. livinarock
Joined: 30 Apr 2008
Total Posts: 2914
18 Aug 2012 06:20 PM
well is there input
Report Abuse
livinarock is not online. livinarock
Joined: 30 Apr 2008
Total Posts: 2914
18 Aug 2012 06:21 PM
i think the problem is local player because what if they dont live near
Report Abuse
ShoeBox4 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
18 Aug 2012 06:26 PM
I just died from laughter.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
18 Aug 2012 06:26 PM
The Command = Hint isn't the problem, I edited that in, these are just pieces of the script.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
18 Aug 2012 06:41 PM
Command = Commands.Hint

Try that.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
18 Aug 2012 06:42 PM
Read my last reply :P
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
18 Aug 2012 06:44 PM
Command = Hint
Is the equivilent of
Command = nil

You are indexing a nil value when you use Command.Action.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
18 Aug 2012 06:45 PM
I know.. I said it's Command = Commands.Hint

The real script runs a for loop through the Commands table and checks the variables

so like

for Nerm,Command in pairs(Commands)do
if(Command.Command[1]=="Hint")then
loadstring(Command.Action)()
end
end
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
18 Aug 2012 07:00 PM
Fixed it.
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