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 » Scripters
Home Search
 

What's the difference?

Previous Thread :: Next Thread 
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 08:40 PM
Having trouble with this piece of script:


chest.open.Metal.Transparency = 0
chest.open.Metal.CanCollide = true
chest.open.Wood.Transparency = 0
chest.open.Wood.CanCollide = true
chest.open.Key.Transparency = 0
chest.closed.Metal.Transparency = 1
chest.closed.Metal.CanCollide = false
chest.closed.Wood.Transparency = 1
chest.closed.Wood.CanCollide = false
chest.closed.Key.Transparency = 1
chest["You already got your award"].Head.Position = Vector3.new(-113.946, 47.358, -394.414)
local players = game.Players:children()
for i = 1, #players do
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Gold ~= nil) then players[i].leaderstats.Gold.Value = 0
end
for i = 1,#workspace:GetChildren() do
pcall(function()
workspace:GetChildren()[i].Humanoid.Health = 0
end)
end
wait(1)
greenscore.Value = 0
redscore.Value = 0
wait(5)
chest.open.Metal.Transparency = 1
chest.open.Metal.CanCollide = false
chest.open.Wood.Transparency = 1
chest.open.Wood.CanCollide = false
chest.open.Key.Transparency = 1
chest.closed.Metal.Transparency = 0
chest.closed.Metal.CanCollide = true
chest.closed.Wood.Transparency = 0
chest.closed.Wood.CanCollide = true
chest.closed.Key.Transparency = 0
chest["You already got your award"].Head.Position = Vector3.new(0, -10, 0)
end
end
end


The chest parts are changed the first time, and the position is altered. Also, the score values are updated. However, in the lines right after, where I am attempting to reverse what was done to the chest in the first half, nothing happens! What's the difference between the bottom chest changes and the top? Especially since the score.Values right before the wait(5) are being updated D:
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 09:42 PM
Bump
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 10:58 PM
Bump :(
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 11:15 PM
Update: It seems if I remove the small section that kills all humanoids, the second chest part works... But I can't figure out why. Here's the full script. Please help :(
(Oh, and I moved an end around)


local greenscore = game.Workspace.FLAGSYSTEM.GreenScore
local redscore = game.Workspace.FLAGSYSTEM.RedScore
local hollowflag = game.Workspace.FLAGSYSTEM.Hollow.Part
local islandflag = game.Workspace.FLAGSYSTEM.Island.Part
local peakflag = game.Workspace.FLAGSYSTEM.Peak.Part
local hollowtop = game.Workspace.FLAGSYSTEM.Hollow.Flag
local islandtop = game.Workspace.FLAGSYSTEM.Island.Flag
local peaktop = game.Workspace.FLAGSYSTEM.Peak.Flag
local music = script.Parent.Parent.Win
local chest = game.Workspace.GreenTreasure

while wait() do -- This will repeat it forever and ever.
repeat -- Changed to repeat, for reasons.
wait(2)
print("The games continue")
until greenscore.Value >= 500 do
script.Parent.Visible = true
print("The games complete")
music:play()
wait()
music:stop()
music:play()
hollowflag.BrickColor = BrickColor.new(1)
islandflag.BrickColor = BrickColor.new(1)
peakflag.BrickColor = BrickColor.new(1)
hollowtop.BrickColor = BrickColor.new(1)
islandtop.BrickColor = BrickColor.new(1)
peaktop.BrickColor = BrickColor.new(1)
chest.open.Metal.Transparency = 0
chest.open.Metal.CanCollide = true
chest.open.Wood.Transparency = 0
chest.open.Wood.CanCollide = true
chest.open.Key.Transparency = 0
chest.closed.Metal.Transparency = 1
chest.closed.Metal.CanCollide = false
chest.closed.Wood.Transparency = 1
chest.closed.Wood.CanCollide = false
chest.closed.Key.Transparency = 1
chest["You already got your award"].Head.Position = Vector3.new(-113.946, 47.358, -394.414)
local players = game.Players:children()
for i = 1, #players do
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Gold ~= nil) then players[i].leaderstats.Gold.Value = 0
end
end
for i = 1,#workspace:GetChildren() do
pcall(function()
workspace:GetChildren()[i].Humanoid.Health = 0
end)
end
wait(1)
greenscore.Value = 0
redscore.Value = 0
wait(5)
chest.open.Metal.Transparency = 1
chest.open.Metal.CanCollide = false
chest.open.Wood.Transparency = 1
chest.open.Wood.CanCollide = false
chest.open.Key.Transparency = 1
chest.closed.Metal.Transparency = 0
chest.closed.Metal.CanCollide = true
chest.closed.Wood.Transparency = 0
chest.closed.Wood.CanCollide = true
chest.closed.Key.Transparency = 0
chest["You already got your award"].Head.Position = Vector3.new(0, -10, 0)
end
end
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 11:27 PM
WHAT IS THIS? If I remove the wait(5) near the end of the script, it all works... WHY?!?
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 11:30 PM
If I add a wait(3) instead it works........
Report Abuse
TheVinny1996 is not online. TheVinny1996
Joined: 13 Apr 2009
Total Posts: 1017
17 Sep 2015 11:31 PM
But wait(4) is too much apparently. Okay I'm so stuck.
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
17 Sep 2015 11:34 PM
RemindMe! 12 hours "shorten this up"
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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