|
| 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
|
  |
| 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
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 28 Jul 2013 08:29 AM |
+ you never call the functions.
I disabled my siggy. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2013 08:30 AM |
| How would I do that then? I thought I called the functions. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
| |
|
|
| 28 Jul 2013 08:48 AM |
| Please, fix this. I don't understand. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 28 Jul 2013 09:26 AM |
@kingmasterfit
That was not a big help. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Jul 2013 09:30 AM |
| 58? I thought there was only 54 lines. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 28 Jul 2013 09:34 AM |
| Real i'm talking about the 2nd script you posted |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 28 Jul 2013 09:55 AM |
| Still there kingmasterfit? |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 28 Jul 2013 11:21 AM |
| That is not the issue superfryx. |
|
|
| Report Abuse |
|
|
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 |
|
|