|
| 19 Jan 2014 03:34 AM |
What is the problem with this script for a training holo? Whenever I use the commands, it doesn't work. Please help!
This it the script for my training holo:
assert(workspace:FindFirstChild("Generator")~=nil,"There is no Generator model!")
gs = {}
trainers = {"NInjaShurikenMaster"}
function globalScript(s) yes = false for i = 1,#gs do if s.Name == gs[i] then yes = true break end end return yes end
game.Players.PlayerAdded:connect(function(player) for i=1,#trainers do if trainers[i]==player.Name then player.Chatted:connect(onDoorSpeak) break end end end)
game.Players.PlayerAdded:connect(function(player) if player:GetRankInGroup(911950) >= 13 then trainers[#trainers+1] = player.Name end for i=1,#trainers do if trainers[i]==player.Name then player.Chatted:connect(onDoorSpeak) break end end end)
function checkEnv() yes = false for _,v in pairs(workspace:GetChildren()) do if v:FindFirstChild("Environment") then yes = true end end return yes end
envtools = { ["nil"] = {}; ["team"] = {"ATK"}; ["sword"] = {"Sword"}; ["gun"] = {"Carbine"}; ["both"] = {"Sword", "Carbine-(30)"}; }
tloc = {"Backpack","StarterGear"}
function resetTools(Player) for _,btool in pairs(Player.Backpack:GetChildren()) do btool:Remove() end for _,stool in pairs(Player.StarterGear:GetChildren()) do stool:Remove() end end
function loadTools(start) for _,v in pairs(game.Players:GetPlayers()) do resetTools(v) for key,val in pairs(envtools) do if string.lower(key) == string.lower(start) then for _,tool in pairs(val) do if game.Lighting:FindFirstChild(tool) then local t = game.Lighting:FindFirstChild(tool) for i = 1,#tloc do t:Clone().Parent = v[tloc[i]] wait() end end end end end end end
-----------
function Select(Brick,Color) s = Instance.new("SelectionBox",Brick) s.Color = BrickColor.new(Color) s.Adornee = Brick workspace.Generator.Connection.Part = Brick workspace.Generator.Connection.Color = BrickColor.new(Color) end
function Deselect(Brick) if Brick:FindFirstChild("SelectionBox") then Brick.SelectionBox:Remove() end workspace.Generator.Connection.Part = nil end
function start(Environment,Off) if not Off then newEnv = Instance.new("Model",workspace) newEnv.Name = Environment.Name envTag = Instance.new("NumberValue",newEnv) envTag.Name = "Environment" for _,v in pairs(Environment:GetChildren()) do if v:IsA("BasePart") then cframe = v.CFrame newP = v:Clone() newP.Parent = newEnv newP.CFrame = cframe Select(newP,"Earth green") wait() Deselect(newP) elseif v:IsA("Script") then if globalScript(v) then newS = v:Clone() newS.Parent = newEnv end end end m = Instance.new("Message",workspace) m.Text = ""..string.upper(Environment.Name).." is finished. Enter when instructed." -- Edit this to whatever you want, or remove it wait(5) m:Remove() elseif Off then for _,v in pairs(Environment:GetChildren()) do if v:IsA("BasePart") then Select(v,"White") wait() v:Remove() end end wait(0.1) Environment:Remove() end end
function onDoorSpeak(msg,recip)
keywords = { sample = {"computer","end","start","ffa1","obby1","obby2","sft","terrain"}; }
keyvals = { ["computer"] = false; ["end"] = false; ["start"] = false; ["ffa1"] = false; ["obby1"] = false; ["obby2"] = false; ["sft"] = false; ["terrain"] = false; ["gft"] = false; ["lava"] = false; ["sharks"] = false; ["colors"] = false; ["2obby"] = false; ["3obby"] = false; ["winter"] = false; ["upisdown"] = false; ["meeting"] = false; ["sharks"] = false; ["desert"] = false; }
for _,v in pairs(keywords) do for i = 1,#v do s,e=string.lower(msg):find(v[i]) if s ~= nil and e ~= nil then if s == e-(v[i]:len()-1) then keyvals[v[i]]=true end end end end wait() if keyvals["computer"] then if keyvals["start"] then if keyvals["ffa1"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["terrain"] then if not checkEnv() then start(game.Lighting["FFA1"]) loadTools("sword") end elseif keyvals["obby1"] and not keyvals["ffa1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["terrain"] then if not checkEnv() then start(game.Lighting["Obby1"]) loadTools("nil") end elseif keyvals["obby2"] and not keyvals["ffa1"] and not keyvals["obby1"] and not keyvals["sft"] and not keyvals["terrain"] then if not checkEnv() then start(game.Lighting["Obby2"]) loadTools("nil") end elseif keyvals["sft"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["ffa1"] and not keyvals["terrain"] then if not checkEnv() then start(game.Lighting["SFT"]) loadTools("nil") end elseif keyvals["terrain"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["Terrain"]) loadTools("sword") end elseif keyvals["sharks"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["sharks"]) loadTools("nil") end elseif keyvals["colours"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["colours"]) loadTools("sword") end elseif keyvals["lava"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["lava"]) loadTools("nil") end elseif keyvals["2obby"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["2obby"]) loadTools("nil") end elseif keyvals["3obby"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["3obby"]) loadTools("nil") end elseif keyvals["winter"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["Winter"]) loadTools("nil") end elseif keyvals["upisdown"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["Upisdown"]) loadTools("nil") end elseif keyvals["stage"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["Stage"]) loadTools("nil") end elseif keyvals["desert"] and not keyvals["obby1"] and not keyvals["obby2"] and not keyvals["sft"] and not keyvals["ffa1"] then if not checkEnv() then start(game.Lighting["Desert"]) loadTools("nil") end end elseif keyvals["end"] then for i, player in pairs(game.Players:GetPlayers()) do player.Character.Torso.CFrame = CFrame.new(-17.1, 18.504, 92.101) end for _,v in pairs(workspace:GetChildren()) do if v:FindFirstChild("Environment") then start(v,true) loadTools("nil") end end end end end |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 03:35 AM |
Probably cause it was a failure
|==The Official Rapper of ATR=| |
|
|
| Report Abuse |
|
|
SN1P3R3D
|
  |
| Joined: 10 Nov 2011 |
| Total Posts: 30891 |
|
|
| 19 Jan 2014 03:35 AM |
Here's the problem
You've came to the wrong neighborhood |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 03:36 AM |
| Go into the output window, then press play. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 03:37 AM |
Meh, not a scripting place. We prefer beating people with flaming sticks. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 03:53 AM |
tl;dr
wrong forum
you didn't even made the script, so no one will help. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jan 2014 03:55 AM |
| No one will help in SH, don't even try lol. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 04:49 AM |
| That script is way too complicated, I can do the same script in about 20 - 30 lines. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 04:55 AM |
It's easy... You go to the right forum
* A pikachu is like a panda * |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 04:57 AM |
| If you go to the forum with bunch of geek,they might solve it for you. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 05:02 AM |
| I tried posting this in the SH but no one helped me. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 05:04 AM |
| Don't be shy.They might solve it soon. |
|
|
| Report Abuse |
|
|