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: Why won't this work?

Previous Thread :: Next Thread 
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:27 AM
Nothing comes up in the workspace. Nor does anything come up in the output. I am trying to make a script so when you say "load:" and then the name of the program within the table that model copies into the workspace. Here is part of the script:

local light = game.lighting

models = {
["program1"] = light.program1,
["program2"] = light.program2,
["program3"] = light.program3,
["program4"] = light.program4
}

function Create(model)
local z = model:Clone()
z.Name = "Program"
z.Parent = workspace
print("SIMULATION LOADED")
end

function endprogram()
if game.Workspace:findFirstChild("Program") ~= nil then
game.Workspace.Program:Destroy()
print("SIMULATION REMOVED") -- Just so we know it ended.
end
function chat(msg,recip)
local prefix=msg:find(":", 1 ,true)
if prefix then
local command = msg:sub(1, prefix-1)
local arg = msg:sub(prefix+1)
--Hopefully this will work.
if command == "load" or command == "run" then
for i,v in pairs(models) do
if arg == i then
Create(models[i])
end
end
end
end
end
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Jul 2013 08:28 AM
game.lighting -> game.Lighting

Capital L. I think it matters.

I disabled my siggy.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
28 Jul 2013 08:29 AM
+ you never call the functions.

I disabled my siggy.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:30 AM
How would I do that then? I thought I called the functions.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:34 AM
bump
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:36 AM
function chat(msg,recip)
local prefix=msg:find(":", 1 ,true)
if prefix then
local command = msg:sub(1, prefix-1)
local arg = msg:sub(prefix+1)
--Hopefully this will work.
if command == "load" or command == "run" then
for i,v in pairs(models) do
if arg == i then
Create(models[i])
end
end
end
end
end
function pladded(nP)
if nP:GetRankInGroup(group) >= trainer then
nP.Chatted:connect(chat)
elseif nP:GetRankInGroup(academy) >= academytrainer then
nP.Chatted:connect(chat)
end
end
end
game.Players.PlayerAdded:connect(pladded)
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:37 AM
It still won't work.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 08:48 AM
Please, fix this. I don't understand.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:16 AM
Please help!
Report Abuse
kingmasterfit is not online. kingmasterfit
Joined: 22 Jul 2012
Total Posts: 2773
28 Jul 2013 09:25 AM
Here is the 1st one done
local light = game.Lighting
models = {
["program1"] = light.program1,
["program2"] = light.program2,
["program3"] = light.program3,
["program4"] = light.program4
}
function Create(model)
local z = model:Clone()
z.Name = "Program"
z.Parent = workspace
print("SIMULATION LOADED")
end
function endprogram()
if game.Workspace:findFirstChild("Program") ~= nil then
game.Workspace.Program:Destroy()
print("SIMULATION REMOVED") -- Just so we know it ended.
end
function chat(msg,recip)
local prefix=msg:find(":", 1 ,true)
if prefix then
local command = msg:sub(1, prefix-1)
local arg = msg:sub(prefix+1)
--Hopefully this will work.
if command == "load" or command == "run" then
for i,v in pairs(models) do
if arg == i then
Create(models[i])
end
end
end
end
end
end
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:26 AM
@kingmasterfit

That was not a big help.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:26 AM
@kingmasterfit

Nvm I thought you were insulting me because it was deleted the first time. Thanks for the help.
Report Abuse
kingmasterfit is not online. kingmasterfit
Joined: 22 Jul 2012
Total Posts: 2773
28 Jul 2013 09:28 AM
No i tried posting both scripts together but it was "too harsh" for roblox
Anyway for your second one delete the "end" on line 58
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:30 AM
58? I thought there was only 54 lines.
Report Abuse
kingmasterfit is not online. kingmasterfit
Joined: 22 Jul 2012
Total Posts: 2773
28 Jul 2013 09:32 AM
Sorry like i said before i tried putting both scripts in but roblox is crying
Delete the one on Line 23
Report Abuse
kingmasterfit is not online. kingmasterfit
Joined: 22 Jul 2012
Total Posts: 2773
28 Jul 2013 09:34 AM
Real i'm talking about the 2nd script you posted
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:35 AM
What second script?
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:38 AM
It's all the same script. But it still isn't working. Perhaps if I posted it all together it would help:


print 'RUNNING'

--local holodoorstatus = "closed"
--local entrydoorstatus = "closed"
local group = 673484
local academy = 898094
local trainer = 140
local academytrainer = 70

local light = game.Lighting

models = {
["program1"] = light.program1,
["program2"] = light.program2,
["program3"] = light.program3,
["program4"] = light.program4
}

function Create(model)
local z = model:Clone()
z.Name = "Program"
z.Parent = workspace
print("SIMULATION LOADED")
end

function endprogram()
if game.Workspace:findFirstChild("Program") ~= nil then
game.Workspace.Program:Destroy()
print("SIMULATION REMOVED") -- Just so we know it ended.
end
function chat(msg,recip)
local prefix=msg:find(":", 1 ,true)
if prefix then
local command = msg:sub(1, prefix-1)
local arg = msg:sub(prefix+1)
--Hopefully this will work.
if command == "load" or command == "run" then
for i,v in pairs(models) do
if arg == i then
Create(models[i])
end
end
end
end
end
end

function pladded(nP)
if nP:GetRankInGroup(group) >= trainer then
nP.Chatted:connect(chat)
elseif nP:GetRankInGroup(academy) >= academytrainer then
nP.Chatted:connect(chat)
end
end
game.Players.PlayerAdded:connect(pladded)
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:44 AM
@kingmasterfit

Why don't you just send it to me in an inbox since roblox is giving you all these problems?
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:48 AM
It was rejected again.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 09:55 AM
Still there kingmasterfit?
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 11:11 AM
Bump.
Report Abuse
Superfryx is not online. Superfryx
Joined: 01 Aug 2011
Total Posts: 3253
28 Jul 2013 11:20 AM
Capital f in FindFirstChild
You said findFirstChild


~local Superfryx=game.Workspace.Awesomeness
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
28 Jul 2013 11:21 AM
That is not the issue superfryx.
Report Abuse
Superfryx is not online. Superfryx
Joined: 01 Aug 2011
Total Posts: 3253
28 Jul 2013 11:23 AM
Im new to scripting, I thought on the wiki it said that capitals where important.


~local Superfryx=game.Workspace.Awesomeness
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