Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I made a time GUI But it doesn't show up when i test the game. Any answers? [closed]

Asked by 5 years ago
Edited by royaltoe 5 years ago

TimeValue = Instance.new("NumberValue") local TextLabel = game.StarterGui.ScreenGui.TextLabel while true do TimeValue.Value = 6 TextLabel.Text = "Time:".. TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 7 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 8 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 9 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 10 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 11 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "AM" .. "[Day Shift]" wait(30) TimeValue.Value = 12 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 1 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "PM" .. "[Day Shift]" wait(30) TimeValue.Value = 2 TextLabel.Text = "Time:" ..TimeValue.Value..":00".. "PM" .. "[Day Shift]" end
0
Hello trickortreat, sorry to say but your script's font is all messed up! It also needs more information and description. I have sent into Moderation so hopefully an Administrator can help you re-arrange your font and help you describe your problem slightly better. Anyhow, enjoy scripting! TheOnlySmarts 233 — 5y
0
TheOnlySmarts here is the script trickortreat333444 -6 — 5y
0
hey onlysmarts trickortreat333444 -6 — 5y
0
Hey! What's up? TheOnlySmarts 233 — 5y
View all comments (4 more)
0
Please fix your code block ForeverBrown 356 — 5y
0
Don't use game.startergui ... when making a ui on the client you need to add it to the PlayerGui instead. ForeverBrown 356 — 5y
0
fixed the code block royaltoe 5144 — 5y
0
hey hey! I do an answer ;) Xapelize 2658 — 5y

Closed as Non-Descriptive by User#5423

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

2 answers

Log in to vote
1
Answered by 5 years ago

When you define TextLabel, you need to use the instance in the PlayerGui(on the client.) So through a local script (if placed inside the textlabel) just do

local textLabel = script.Parent

Please be more descriptive with your questions in the future. Though I can see what your problem is based on the title, it is hard for us to get you the help you need to actually fix the problem if we don't know things like...what kind of script it is, where the script is, what you are trying to achieve, etc etc.

Ad
Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You can try to make an IntValue, I always use IntValue to make the game works. Maybe it will like this. You don't need to type so much. I might just help you make the script become not messy so you can maybe find out the answer.

local TimeValue = Instance.new("IntValue") -- maybe try IntValue instead of NumberValue
local AM_Or_PM = Instance.new("Part") -- make it find out was the timer is AM or PM
local IntValue = Instance.new("IntValue") -- Set this make the AM_Or_PM sets AM_Or_PM
TimeValue.Value = 6 -- set the start value
--the part properties--
AM_Or_PM.Name = "AM"
AM_Or_PM.Transparency = 1
AM_Or_PM.Position = Vector3.new(0,0,0)
AM_Or_PM.Anchored = false
AM_Or_PM.CanCollide = false
AM_Or_PM.Parent = game.Workspace
IntValue.Value = 0
--Don't delete those

while true do

    wait(30)
    if TimeValue.Value > 12 then
        if IntValue == 0 then
            AM_Or_PM.Name = "PM"
            IntValue.Value = 1
            TimeValue.Value = 1
            else
            AM_Or_PM.Name = "AM"
            IntValue.Value = 0
            TimeValue.Value = 1
        end
        else
    TextLabel.Text = "Time:" ..TimeValue.Value..":00".. AM_Or_PM.Name .. "[Day Shift]"
    TimeValue.Value = TimeValue.Value + 1
    end
end

Maybe this will help you! My Roblox Studio crashed while I run this script, if you see that doesn't have any errors, please accept my answer :D If it not work, then I hope ya... Happy coding ;D

0
It crashed becuase you forgot the wait() on the infinite loop lol. Psudar 882 — 5y