|
| 30 Apr 2016 09:32 AM |
What can I use when:
Pressing a button --> door closes --> Sign says: CLOSED Pressing a button --> door opens --> Sign says: OPEN
I only need the "Sign says: OPEN / CLOSED" part, I got the door that opens and closes
|
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 30 Apr 2016 09:34 AM |
| Well we can't help you more specifically if you don't give us the script but make it so when the door opens a value inside it changes, then have another script check the value and change the text label accordingly. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 09:36 AM |
v = script.Parent.Parent.Value click = script.Parent.ClickDetector
function wat(player) if player.TeamColor == script.Parent.Parent.Parent.Parent.TeamColor.Value then if v.Value == true then v.Value = false script.Parent.BrickColor = BrickColor.new("Really red") for i,v in pairs(script.Parent.Parent.Doors:GetChildren()) do v.CanCollide = false for i,v in pairs(script.Parent.Parent.Glass:GetChildren()) do v.Transparency = 0.6 v.CanCollide = false end end elseif v.Value == false then v.Value = true script.Parent.BrickColor = BrickColor.new("Lime green") for i,v in pairs(script.Parent.Parent.Doors:GetChildren()) do v.CanCollide = false for i,v in pairs(script.Parent.Parent.Glass:GetChildren()) do v.Transparency = 0 v.CanCollide = true end end end end end
click.MouseClick:connect(wat)
This is the script I got now, for opening and closing the door. This works perfectly, but when I try adding a "Text changer" it doesnt really work. |
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
| |
|
| |
|
|
| 30 Apr 2016 09:42 AM |
| He means in relation to the script. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 09:46 AM |
My English is not perfect, but I think you mean this: In the Explorer you got:
-Doors -Value -Doors (Model -Glass (Model -OpenSign -Display -GUI (Surface GUI) -Open (TekstLabel) -Button -ClickDetector -Script |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 09:59 AM |
I tried adding this:
script.Parent.Parent.OpenSign.Display.GUI.Open.Text = OPEN
under:
script.Parent.BrickColor = BrickColor.new("Really red")
And
script.Parent.Parent.OpenSign.Display.GUI.Open.Text = CLOSED
under:
script.Parent.BrickColor = BrickColor.new("Lime green")
But it doesn't work.
|
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 30 Apr 2016 10:28 AM |
script.Parent.Parent.OpenSign.Display.GUI.Open.Text = OPEN
^ almost right
script.Parent.Parent.OpenSign.Display.GUI.Open.Text = "OPEN"
Quotation marks are important. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:29 AM |
I tried that already, but than the whole door doesn't work anymore....
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:32 AM |
Got it working, i forgot a dot ;)
Thanks! |
|
|
| Report Abuse |
|
|