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: GUI

Previous Thread :: Next Thread 
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 06:59 PM
So in my game, I'm trying to get a GUI change text on click, and then teleport you. I have the first part, but I can't get it to teleport.

This is my script for changing text:
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent

-- Create TextButton
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Teleport"

-- Bind function to button click
textButton.MouseButton1Down:connect(function()
textButton.Text = "5"
wait(1)
textButton.Text = "4"
wait(1)
textButton.Text = "3"
wait(1)
textButton.Text = "2"
wait(1)
textButton.Text = "1"
wait(1)
end)

Any help??
Report Abuse
UltraTechX is not online. UltraTechX
Joined: 24 Oct 2013
Total Posts: 350
27 Sep 2015 07:00 PM
where is the teleporting code after the countdown?
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:03 PM
I put it under the textButton.Text = "1"
wait(1)
Report Abuse
UltraTechX is not online. UltraTechX
Joined: 24 Oct 2013
Total Posts: 350
27 Sep 2015 07:04 PM
no you didnt, end) is after that.
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:05 PM
I put the script for the text change up there, this is the entire script:

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent

-- Create TextButton
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Teleport"

-- Bind function to button click
textButton.MouseButton1Down:connect(function()
textButton.Text = "5"
wait(1)
textButton.Text = "4"
wait(1)
textButton.Text = "3"
wait(1)
textButton.Text = "2"
wait(1)
textButton.Text = "1"
wait(1)
wait(1)
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-16.173, 18.199, -370.13)
end)
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
27 Sep 2015 07:06 PM
textButton.Text = "5"
wait(1)
textButton.Text = "4"
wait(1)
textButton.Text = "3"
wait(1)
textButton.Text = "2"
wait(1)
textButton.Text = "1"
wait(1)

for i = 5, 1, -1 do
textButton.Text = i
wait(1)
end
wait(1)

➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:07 PM
Explain that script please, I understand what it's doing but what do I do with it?
Report Abuse
Blues714 is not online. Blues714
Joined: 23 Dec 2008
Total Posts: 6507
27 Sep 2015 07:09 PM
for i = 5, 1, -1 do
textButton.Text = i
wait(1)
end
wait(1)

is a much more efficient way to counting down.
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
27 Sep 2015 07:10 PM
He's telling you to replace your long line of wait(1) change text wait(1) change text and so on with a for loop like the one he posted.

-The [Guy]
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:10 PM
Ah. I do things the old way, thank you for that much shorter script part. But the issue is still here about the teleporting
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
27 Sep 2015 07:14 PM
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = Color3.new(1, 1, 1)
textButton.Text = "Teleport"

-- Bind function to button click
textButton.MouseButton1Down:connect(function()
for i = 5, 1, -1 do
textButton.Text = i
wait(1)
end
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-16.173, 18.199, -370.13)
end)

Should work fine...
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:20 PM
Nope, I put it in starterGUI and in a screen GUI and it doesn't TP nor does it countdown
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
27 Sep 2015 07:22 PM
??? Put a print statement in the click function to see if it's even getting called.

-The [Guy]
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:24 PM
It's not even being called. Weird.
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
27 Sep 2015 07:26 PM
"Ah. I do things the old way, thank you for that much shorter script part. But the issue is still here about the teleporting"

The old way? That's not an "old way"
That's an extremely dumb way.
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:27 PM
you wana fite m8?
Report Abuse
XxSkrublordsxX is not online. XxSkrublordsxX
Joined: 28 May 2011
Total Posts: 64
27 Sep 2015 07:30 PM
Nvm it is being called on, I just didn't see it. I had like 300 commands come in at once and I missed it.
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