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: What did I do wrong?

Previous Thread :: Next Thread 
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 03:44 PM
13:42:18.880 - TimerScreen is not a valid member of StarterGui
13:42:18.886 - Script 'Players.Player1.Backpack.LocalScript', Line 3
13:42:18.891 - Stack End

local Time = game.Workspace.TouchPart

local timerGui = game.StarterGui.TimerScreen

Time.Touched:connect(function()
for i = 180, 0, -1 do
wait(1)
timerGui.Timer.Numbers.Text = i
if i == 0 then
break
end
end
end)

There is a screengui i renamed "TimerScreen" inside StarterGui
timerGui is the frame. Numbers is a textlabel.....

What am I doing wrong? Just trying to make a simple gui that counts down.....
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
02 Aug 2015 03:45 PM
You have to edit playergui not startergui
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
02 Aug 2015 03:47 PM
Capitalization matters, also, you would want to get the PlayerGui, because StarterGui does not display, it's a container for GUIs that go into a player for when they spawn.
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 03:52 PM
How would I re-write the script to get it in PlayerGui then?
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 03:53 PM
You're changing the text inside of a folder called StarterGui. You want it to be PlayerGui, assuming you're working in a local script (which you are).

PlayerGui presides in the Player. So, you might want to consider a variable for Player.


So, something like:

local Time = game.Workspace.TouchPart
local Player = script.Parent.Parent
local timerGui = Player.PlayerGui.TimerScreen

Time.Touched:connect(function()
--consider putting a debounce
for i = 180, 0, -1 do
wait(1)
timerGui.Timer.Numbers.Text = i
if i == 0 then
break
end
end
end)
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 05:11 PM
local Player = script.Parent.Parent????

where would I put this??? Where would the script be at??
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 05:15 PM
The gui goes in StarterGui, the script goes....i dunno i'm confused now...
Report Abuse
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
02 Aug 2015 05:15 PM
player = game.Players:FindFirstChild(script.Parent.Parent.Name)
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 05:20 PM
Thx for rewriting it, but i still don't know where to put the actual script. I know it's in a local script, but what folder shall i put it in? Workspace? StarterGui? Players???
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 05:30 PM
b
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 05:34 PM
StarterGui
-->TheScript

I think.
Report Abuse
KenjiMatsumura is not online. KenjiMatsumura
Joined: 01 Dec 2013
Total Posts: 195
02 Aug 2015 05:37 PM
HOLY CRAP!!!


IT WORKS!!!


Thanks so much everyone for you help :)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
02 Aug 2015 05:59 PM
to clear up your confusion:
http://wiki.roblox.com/index.php?title=User:MrNicNac/Where_are_all_the_GUIs%3F

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