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: Text changing when button pressed...?

Previous Thread :: Next Thread 
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
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 is not online. 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
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
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 is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
30 Apr 2016 09:39 AM
Where is the sign?
Report Abuse
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
30 Apr 2016 09:40 AM
What do you exactly mean?
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
30 Apr 2016 09:42 AM
He means in relation to the script.
Report Abuse
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
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
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
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 is not online. 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
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
30 Apr 2016 10:29 AM
I tried that already, but than the whole door doesn't work anymore....
Report Abuse
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
30 Apr 2016 10:32 AM
Got it working, i forgot a dot ;)

Thanks!
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