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
 

Re: The room appears, but doesn't disappear

Previous Thread :: Next Thread 
HalfPinky456 is not online. HalfPinky456
Joined: 10 Apr 2011
Total Posts: 6236
04 Dec 2016 07:23 PM
so i've made this room and when you click a certain button, it's supposed to appear. when you click it again, it should disappear. however, it appears, but never disappears

local b = workspace.buttons
local r = workspace.room
local iceb = b.iceCave
local bunb = b.bunker
local beab = b.beach
local forb = b.forest
local temb = b.temple
local norb = b.normal
local i = true
local bb = true
local be = true
local f = true
local t = true
local n = true

iceb.ClickDetector.MouseClick:connect(function()
if i then
i = false
for i,v in pairs(workspace.iced:GetChildren()) do
v.Transparency = 0
v.CanCollide = true
for i,v in pairs(r:GetChildren()) do
if v.Name == "iWall" then
v.Transparency = 0
v.Material = "Ice"
elseif v.Name == "Carpet" then
v.Material = "Ice"
end
end
end
end
end)

iceb.ClickDetector.MouseClick:connect(function()
if not i then
i = true
for i,v in pairs(workspace.iced:GetChildren()) do
v.Transparency = 1
v.CanCollide = false
for i,v in pairs(r:GetChildren()) do
if v.Name == "iWall" then
v.Transparency = 1
elseif v.Name == "Carpet" then
v.Material = "Fabric"
end
end
end
end
end)

attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯
Report Abuse
HalfPinky456 is not online. HalfPinky456
Joined: 10 Apr 2011
Total Posts: 6236
04 Dec 2016 07:34 PM
bb

attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯
Report Abuse
steven73598233 is online. steven73598233
Joined: 12 Jun 2016
Total Posts: 440
04 Dec 2016 08:59 PM
Try using a different technique. My suggestion is that every time a player clicks the part, a variable changes depending on its current value, and other parts of the script activate when the variable = 1 or 2
Report Abuse
HalfPinky456 is not online. HalfPinky456
Joined: 10 Apr 2011
Total Posts: 6236
05 Dec 2016 04:45 PM
bump

attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯
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