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: Can anyone fix this for me?

Previous Thread :: Next Thread 
moutaindew101 is not online. moutaindew101
Joined: 14 Apr 2009
Total Posts: 5417
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 is not online. 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 is not online. 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
moutaindew101 is not online. moutaindew101
Joined: 14 Apr 2009
Total Posts: 5417
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 is not online. 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
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