|
| 24 Jul 2012 12:04 AM |
| I know enough lua to look at scripts and examine them to see what functions and stuff they do, but I don't make scripts. I decided to create a sliding door based off scripts from a free model called Vault A. I've tried editing the scripts so the doors slide out instead of down, but it didn't work. If anyone could go into solo mode of this map and tell me what the problem is and how to solve it I would be happy. http://www.roblox.com/Blank-place?id=9956067 is the place it's on. The giant ice door is mine, while the grey and yellow door is the one from the vault. To open the door you use the Entrance tool and walk into the white box and when the red dot turns green, click the green brick. |
|
|
| Report Abuse |
|
|
wow75
|
  |
| Joined: 16 Jan 2009 |
| Total Posts: 951 |
|
|
| 24 Jul 2012 12:06 AM |
First: Sweet warhelm. 2nd: Can you post the script here? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Jul 2012 12:08 AM |
| Editing scripts is different from making them. If you know enough Lua to look at scripts and realize what they do you should realize you can make the scripts from scratch. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2012 12:13 AM |
The door uses multiple scripts, but the one I'm having trouble with is labeled Activator. I have no idea what it's for other than repositioning blocks, but I'm not completely sure it's for that either. There's 2 of them, one in both sides of the door which are the same exact scripts, and one in the main model (Each door is a model, which is in another model which has the red dots and white boxes.) Here's the script for each door: function get(x) local g = x:GetChildren() for i = 1, # g do if g[i].className == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, 5, 0) else get(g[i]) end end end
get(script.Parent)
And here is the main one:
function Activate() if script.Parent.Parent.Power.Value == true then if script.Parent.Parent.Active.Value == true then local g = script.Parent:GetChildren() for b = 1, 75 do for i = 1, # g do if g[i].className == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, .1, 0) end end wait(.025) end wait(3) local g = script.Parent:GetChildren() for b = 1, 75 do for i = 1, # g do if g[i].className == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, -.1, 0) end end wait(.025) end end script.Parent.Parent.Active.Value = false end end
script.Parent.Parent.Active.Changed:connect(Activate) |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Jul 2012 12:19 AM |
function get(x) local g = x:GetChildren() for i = 1, #g do if g[i].ClassName == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, 5, 0) else get(g[i]) end end end
get(script.Parent)
And here is the main one:
function Activate() if script.Parent.Parent.Power.Value == true and script.Parent.Parent.Active.Value == true then local g = script.Parent:GetChildren() for b = 1,75 do for i = 1, #g do if g[i].ClassName == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, .1, 0) end end wait(.025) end wait(3) local g = script.Parent:GetChildren() for b = 1,75 do for i = 1,#g do if g[i].ClassName == "Part" then g[i].CFrame = g[i].CFrame + Vector3.new(0, -.1, 0) end end wait(.025) end end script.Parent.Parent.Active.Value = false end
script.Parent.Parent.Active.Changed:connect(Activate)
Your script can be improved a bit more I have to admit. But I have to say name your variables better :/ |
|
|
| Report Abuse |
|
|