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 Headache... [GOOD LUCK!!!!!!]

Previous Thread :: Next Thread 
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
23 Jan 2012 09:28 PM
I fixed all the errors the Output gave to me... Now nothing happens and the output doesn't show anything:

(Note: all the conditional statements are the same (except the number after R changes))



script.Parent.MouseButton1Down:connect(function(mouse)
player = script.Parent.Parent.Parent.Parent.Parent
gh = script.Parent.Parent.Parent.BombValue
ty = script.Parent.Parent.Parent.Building
lol = game.Workspace:findFirstChild(gh.Value)
lolz = game.Workspace:findFirstChild(ty.Value)

s = lol:Clone()
f = lolz:Clone()

if game.Workspace.R1.Occupied == false then
if lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R1
f.Parent = game.Workspace.R1
s:MoveTo(game.Workspace.R1.bv.Position)
f:MoveTo(game.Workspace.R1.ev.Position)
player.Character:MoveTo(game.Workspace.R1.Spawn.Position)
game.Workspace.R1.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

if game.Workspace.R2.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R2
f.Parent = game.Workspace.R2
lol:MoveTo(game.Workspace.R2.bv.Position)
lolz:MoveTo(game.Workspace.R2.ev.Position)
player.Character:MoveTo(game.Workspace.R2.Spawn.Position)
game.Workspace.R2.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

if game.Workspace.R3.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R3
f.Parent = game.Workspace.R3
lol:MoveTo(game.Workspace.R3.bv.Position)
lolz:MoveTo(game.Workspace.R3.ev.Position)
player.Character:MoveTo(game.Workspace.R3.Spawn.Position)
game.Workspace.R3.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

if game.Workspace.R4.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R4
f.Parent = game.Workspace.R4
lol:MoveTo(game.Workspace.R4.bv.Position)
lolz:MoveTo(game.Workspace.R4.ev.Position)
player.Character:MoveTo(game.Workspace.R4.Spawn.Position)
game.Workspace.R4.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

if game.Workspace.R5.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R5
f.Parent = game.Workspace.R5
lol:MoveTo(game.Workspace.R5.bv.Position)
lolz:MoveTo(game.Workspace.R5.ev.Position)
player.Character:MoveTo(game.Workspace.R5.Spawn.Position)
game.Workspace.R5.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

if game.Workspace.R6.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R6
f.Parent = game.Workspace.R6
lol:MoveTo(game.Workspace.R6.bv.Position)
lolz:MoveTo(game.Workspace.R6.ev.Position)
player.Character:MoveTo(game.Workspace.R6.Spawn.Position)
game.Workspace.R6.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #s do
if s[i].ClassName == "Part" then
s[i].Anchored = false
end
end
end
end

end)
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
23 Jan 2012 10:21 PM
Bump
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
23 Jan 2012 10:22 PM
Thanks for the headache to.

It's not easy being cheesy.
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
23 Jan 2012 10:26 PM
"for i = 1, #s do"

pretty sure s is not a table

if output doesnt say anything about that, it leads me to think that this part of the code never executes. use prints and check that all the variables and such are what they are supposed to be and that the script actually runs everything you want it to run.
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
23 Jan 2012 10:48 PM
@crazy: I'm so stupid! xD
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
23 Jan 2012 10:49 PM
would it be mean to agree with you
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
23 Jan 2012 11:05 PM
Nope.

Still a headache though:

script.Parent.MouseButton1Down:connect(function(mouse)
player = script.Parent.Parent.Parent.Parent.Parent
gh = script.Parent.Parent.Parent.BombValue
ty = script.Parent.Parent.Parent.Building
lol = game.Workspace:findFirstChild(gh.Value)
lolz = game.Workspace:findFirstChild(ty.Value)

s = lol:Clone()
f = lolz:Clone()
q = s:getChildren()

if game.Workspace.R1.Occupied == false then
if lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R1
f.Parent = game.Workspace.R1
s:MoveTo(game.Workspace.R1.bv.Position)
f:MoveTo(game.Workspace.R1.ev.Position)
player.Character:MoveTo(game.Workspace.R1.Spawn.Position)
game.Workspace.R1.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
elseif game.Workspace.R1.Occupied == true then
if game.Workspace.R2.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R2
f.Parent = game.Workspace.R2
lol:MoveTo(game.Workspace.R2.bv.Position)
lolz:MoveTo(game.Workspace.R2.ev.Position)
player.Character:MoveTo(game.Workspace.R2.Spawn.Position)
game.Workspace.R2.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
elseif game.Workspace.R2.Occupied == true then
if game.Workspace.R3.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R3
f.Parent = game.Workspace.R3
lol:MoveTo(game.Workspace.R3.bv.Position)
lolz:MoveTo(game.Workspace.R3.ev.Position)
player.Character:MoveTo(game.Workspace.R3.Spawn.Position)
game.Workspace.R3.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
elseif game.Workspace.R3.Occupied == true then
if game.Workspace.R4.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R4
f.Parent = game.Workspace.R4
lol:MoveTo(game.Workspace.R4.bv.Position)
lolz:MoveTo(game.Workspace.R4.ev.Position)
player.Character:MoveTo(game.Workspace.R4.Spawn.Position)
game.Workspace.R4.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
elseif game.Workspace.R4.Occupied == true then
if game.Workspace.R5.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R5
f.Parent = game.Workspace.R5
lol:MoveTo(game.Workspace.R5.bv.Position)
lolz:MoveTo(game.Workspace.R5.ev.Position)
player.Character:MoveTo(game.Workspace.R5.Spawn.Position)
game.Workspace.R5.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
elseif game.Workspace.R5.Occupied == true then
if game.Workspace.R6.Occupied == false then
if game.Workspace.lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace.R6
f.Parent = game.Workspace.R6
lol:MoveTo(game.Workspace.R6.bv.Position)
lolz:MoveTo(game.Workspace.R6.ev.Position)
player.Character:MoveTo(game.Workspace.R6.Spawn.Position)
game.Workspace.R6.XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end

end)
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
23 Jan 2012 11:05 PM
Is there a better way to do it than the above?
Report Abuse
crazytomato4 is not online. crazytomato4
Joined: 09 Feb 2011
Total Posts: 1368
23 Jan 2012 11:23 PM
yes, there most likely is. i'm too lazy to try and figure it out though. plus, seeing as there are several elseif statements in that script that it seems are supposed to correspond with the very first if statement, i'd say quite a few of those ends are in the wrong place.
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
24 Jan 2012 02:46 AM
*shudders* that code looks so inefficient and ugly!
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
24 Jan 2012 02:52 AM
script.Parent.MouseButton1Down:connect(function(mouse)
player = script.Parent.Parent.Parent.Parent.Parent
gh = script.Parent.Parent.Parent.BombValue
ty = script.Parent.Parent.Parent.Building
lol = game.Workspace:findFirstChild(gh.Value)
lolz = game.Workspace:findFirstChild(ty.Value)

s = lol:Clone()
f = lolz:Clone()
q = s:GetChildren()

for ii=1,6 do

if game.Workspace["R"..ii].Occupied == false then
if lol ~= nil then
s:MakeJoints()
f:MakeJoints()
s.Parent = game.Workspace["R"..ii]
f.Parent = game.Workspace["R"..ii]
s:MoveTo(game.Workspace["R"..ii].bv.Position)
f:MoveTo(game.Workspace["R"..ii].ev.Position)
player.Character:MoveTo(game.Workspace["R"..ii].Spawn.Position)
game.Workspace["R"..ii].XP.Value = 200^(gh.Value) + 100^(ty.Value)
for i = 1, #q do
if q[i].ClassName == "Part" then
q[i].Anchored = false
end
end
end
end

end

end)
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
24 Jan 2012 02:53 AM
lol remeber when I started calling u old school ealrier? now you new name is Mr. Old-School

[/troll]
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
24 Jan 2012 07:07 PM
I know I'm old school... This new stuff just kills me. And thanks, btw. I'll try it! I agree it was WAY inefficient.
Report Abuse
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
24 Jan 2012 07:08 PM
"end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end"


............You expect people to read all that script and not give an output?....

Free models....horrible idea....
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
24 Jan 2012 07:10 PM
@Wafles, Says the one who uses Free Models.

It's not easy being cheesy.
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
24 Jan 2012 07:19 PM
@Wafles, read the thread BEFORE YOU RESPOND.

By the way, I haven't even touched a free model in over 3 years now.
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
24 Jan 2012 07:22 PM
Still doesn't work. Thanks Bluey, but looks like I need to wake up ElectricAxel >.>
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
24 Jan 2012 07:23 PM
np, Mr. Old-School, is there any output in the script? or is it a logical error?
Report Abuse
slayer219 is not online. slayer219
Joined: 15 Nov 2008
Total Posts: 3445
24 Jan 2012 07:34 PM
No output :(
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
24 Jan 2012 08:07 PM
:( could it be caused from other scripts not doing what their meant to do?
Report Abuse
rcm is not online. rcm
Joined: 29 Jul 2008
Total Posts: 621
24 Jan 2012 08:17 PM
If you can't seem to find anything else wrong with it, then just add a bunch of print()s in the script and see where it stops printing.

example:

print("start")
if blah == 5 then
print("blah")
dostuff()
else
print("not blah")
dootherstuff()
end

When you find the spot where it stops printing, add a bunch more prints around that area until you find the exact line, and hopefully find the problem. :)
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
25 Jan 2012 12:09 AM
and use trial and error :)
Report Abuse
wafles26122 is not online. wafles26122
Joined: 14 Jun 2010
Total Posts: 958
30 Jan 2012 04:44 PM
woah woah woah, who ever said I used free models? Since when?

Death to free models.
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