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: My script won't run?

Previous Thread :: Next Thread 
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 10:41 PM
So, I put a script in a little model, and when it's inside the model, it doesn't run, but when it's in workspace, it runs. What can I do to fix it?
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 10:52 PM
bump
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 10:59 PM
Whats the script?
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:01 PM
Its just a really inefficient script that has to do with making an NPC invisible and another visible, then making a ladder visible.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:01 PM
And the script is in the 1st NPC
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:03 PM
Well we can't help you if we can't see the script.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:08 PM
I'll post it, but its 200 lines inefficient...
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:09 PM
if true then do

----------------------------- person 1

a = script.Parent.Hat
b = script.Parent.Head
c = script.Parent["Left Arm"]
d = script.Parent["Left Leg"]
e = script.Parent["Right Arm"]
f = script.Parent["Right Leg"]
g = script.Parent.Torso

a.Transparency = 1
a.CanCollide = false

b.Transparency = 1
b.CanCollide = false

c.Transparency = 1
c.CanCollide = false

d.Transparency = 1
d.CanCollide = false

e.Transparency = 1
e.CanCollide = false

f.Transparency = 1
f.CanCollide = false

g.Transparency = 1
g.CanCollide = false

---------------------------------- person 2

other = game.Workspace["There you go. Hurry up."]

a2 = other.Hat
b2 = other.Head
c2 = other["Left Arm"]
d2 = other["Left Leg"]
e2 = other["Right Leg"]
f2 = other["Right Arm"]
g2 = other.Torso

a2.Transparency = 0
a2.CanCollide = true

b2.Transparency = 0
b2.CanCollide = true

b2.face.Texture = "rbxasset://textures/face.png"

c2.Transparency = 0
c2.CanCollide = true

d2.Transparency = 0
d2.CanCollide = true

e2.Transparency = 0
e2.CanCollide = true

f2.Transparency = 0
f2.CanCollide = true

g2.Transparency = 0
g2.CanCollide = true

------------------------------- 10 part ladder

lad = game.Workspace["Elf Ladder"]

lad1 = lad.Ladder1
lad2 = lad.Ladder2
lad3 = lad.Ladder3
lad4 = lad.Ladder4
lad5 = lad.Ladder5
lad6 = lad.Ladder6
lad7 = lad.Ladder7
lad8 = lad.Ladder8
lad9 = lad.Ladder9
lad10 = lad.Ladder10

lad1.Transparency = 0
lad1.CanCollide = true

lad2.Transparency = 0
lad2.CanCollide = true

lad3.Transparency = 0
lad3.CanCollide = true

lad4.Transparency = 0
lad4.CanCollide = true

lad5.Transparency = 0
lad5.CanCollide = true

lad6.Transparency = 0
lad6.CanCollide = true

lad7.Transparency = 0
lad7.CanCollide = true

lad8.Transparency = 0
lad8.CanCollide = true

lad9.Transparency = 0
lad9.CanCollide = true

lad10.Transparency = 0
lad10.CanCollide = true

------------------------------- 10 second wait
wait (10)
------------------------------- reverse

a.Transparency = 0
a.CanCollide = true

b.Transparency = 0
b.CanCollide = true

c.Transparency = 0
c.CanCollide = true

d.Transparency = 0
d.CanCollide = true

e.Transparency = 0
e.CanCollide = true

f.Transparency = 0
f.CanCollide = true

g.Transparency = 0
g.CanCollide = true

------------------------------ 2nd reverse

a2.Transparency = 1
a2.CanCollide = false

b2.Transparency = 1
b2.CanCollide = false

b2.face.Texture = "rbxasset://t346"

c2.Transparency = 1
c2.CanCollide = false

d2.Transparency = 1
d2.CanCollide = false

e2.Transparency = 1
e2.CanCollide = false

f2.Transparency = 1
f2.CanCollide = false

g2.Transparency = 1
g2.CanCollide = false

----------------------------- ladder reverse

lad1.Transparency = 1
lad1.CanCollide = true

lad2.Transparency = 1
lad2.CanCollide = true

lad3.Transparency = 1
lad3.CanCollide = true

lad4.Transparency = 1
lad4.CanCollide = true

lad5.Transparency = 1
lad5.CanCollide = true

lad6.Transparency = 1
lad6.CanCollide = true

lad7.Transparency = 1
lad7.CanCollide = true

lad8.Transparency = 1
lad8.CanCollide = true

lad9.Transparency = 1
lad9.CanCollide = true

lad10.Transparency = 1
lad10.CanCollide = true

-------------------------- done
wait ()
script.Disabled = true

end
end
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:14 PM
if true then do?

What is true?
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:18 PM
If the script is, which it is.

What do you suggest I do? If script.Name = script then

I really don't care what I put at the top of my script. Maybe you could actually help me instead of just saying, your scripts wrong, but I'm not gonna tell you what's wrong.
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
19 Feb 2012 11:21 PM
I can only assume that you have the hierarchies messed up
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:21 PM
--Perhaps this?

PartsToTransparify = {script.Parent.Hat.Handle,script.Parent.Head,script.Parent["Left Arm"], script.Parent["Left Leg"], script.Parent["Right Arm"],script.Parent["Right Leg"], script.Parent.Torso}
while true do
for i = 1,#PartsToTransparify do
PartsToTransparify[i].Transparency = 0
PartsToTransparify.CanCollide = false
end
other = game.Workspace["There you go. Hurry up."]:GetChildren()
b2 = other.Head
for i = 1,#other do
if other[i]:IsA("BasePart") then
other[i].Transparency = 1
other[i].CanCollide = false
end
end
b2.face.Transparency = 1
lad = game.Workspace["Elf Ladder"]:GetChildren()
for i = 1,#lad do
lad[i].Transparency = 1
lad[i].CanCollide = false
end
wait(10)
for i = 1,#PartsToTransparify do
PartsToTransparify[i].Transparency = 0
PartsToTransparify.CanCollide = true
end
other = game.Workspace["There you go. Hurry up."]:GetChildren()
b2 = other.Head
for i = 1,#other do
if other[i]:IsA("BasePart") then
other[i].Transparency = 0
other[i].CanCollide = true
end
end
b2.face.Transparency = 1
lad = game.Workspace["Elf Ladder"]:GetChildren()
for i = 1,#lad do
lad[i].Transparency = 0
lad[i].CanCollide = true
end
end



--Lemme know if it works. If it doesn't tell me what the output says.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:22 PM
Well, there's not output, so I don't think it is, unless there's something seriously messed up.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 11:22 PM
Oh, and I havn't checked out the script yet, I'll test it in the morning though.
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:23 PM
I hope I helped.

Learn from what I wrote to help make your coding more efficient :)
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:24 PM
-- Whoops. Made a small mistake

PartsToTransparify = {script.Parent.Hat.Handle,script.Parent.Head,script.Parent["Left Arm"], script.Parent["Left Leg"], script.Parent["Right Arm"],script.Parent["Right Leg"], script.Parent.Torso}
while true do
for i = 1,#PartsToTransparify do
PartsToTransparify[i].Transparency = 0
PartsToTransparify.CanCollide = false
end
other = game.Workspace["There you go. Hurry up."]:GetChildren()
b2 = other.Head
for i = 1,#other do
if other[i]:IsA("BasePart") then
other[i].Transparency = 1
other[i].CanCollide = false
end
end
b2.face.Transparency = 1
lad = game.Workspace["Elf Ladder"]:GetChildren()
for i = 1,#lad do
lad[i].Transparency = 1
lad[i].CanCollide = false
end
wait(10)
for i = 1,#PartsToTransparify do
PartsToTransparify[i].Transparency = 0
PartsToTransparify.CanCollide = true
end
other = game.Workspace["There you go. Hurry up."]:GetChildren()
b2 = other.Head
for i = 1,#other do
if other[i]:IsA("BasePart") then
other[i].Transparency = 0
other[i].CanCollide = true
end
end
b2.face.Transparency = 0
lad = game.Workspace["Elf Ladder"]:GetChildren()
for i = 1,#lad do
lad[i].Transparency = 0
lad[i].CanCollide = true
end
end
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
20 Feb 2012 09:47 AM
Yeahhhhhhhhhhhhh I really gotta work on my efficiency...
But thanks for helping.
Report Abuse
karateperson is not online. karateperson
Joined: 19 Feb 2010
Total Posts: 1988
20 Feb 2012 09:51 AM
You said when you put it in a model it didn't work?
other = game.Workspace
a1 = other.Hat

If the hat is in the model, then there is no "Hat" part in Workspace, unless there is a different block called Hat. Change it to other.MODELNAME.Hat. Will that work?
Report Abuse
karateperson is not online. karateperson
Joined: 19 Feb 2010
Total Posts: 1988
20 Feb 2012 09:52 AM
a2, sorry.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
20 Feb 2012 09:56 AM
Hat is in the model, where it is supposed to be, and other = game.Workspace.["a guy that I just put in"]
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
20 Feb 2012 10:04 AM
Figured out a solution. Thanks for trying to help though.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
20 Feb 2012 10:13 AM
I think it should be
"While true do"
Im not sure I haven't scripted in a loong time.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
20 Feb 2012 10:17 AM
actually it would be while true do (w not capitalized) and it could be, but loops cause lag...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
20 Feb 2012 10:18 AM
Okay I haven't scripting in like a year so I forgot. xD.
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