tell me which of these prints worked
That did the same thing as the one before
tell me which of these prints worked so we can see where the issue is
They both printed done it also printed 30 for some reason
also this script is in StarterCharacterScripts
we have time
and TimerText
.
which of them is the one you want?
Time is an int value its the one that supposed to count down
local Time = game:GetService("ReplicatedStorage"):WaitForChild("Time")
local player = game:GetService("Players").LocalPlayer
local timeText = game:GetService("ReplicatedStorage"):WaitForChild("TimerText")
local textLabel = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("TextLabel")
Time.Value = 30
while true do
task.wait(1)
for i = Time.Value, 0, -1 do
print("done") -- print?
Time.Value= i
textLabel.Text = "game starts in "..i.."s"
print(timeText.Value) -- print?
if Time.Value == 0 then
print("done") -- print?
player.Character.PrimaryPart.Position = game.Workspace.Part.Position
textLabel.Visible = false
break
end
end
end
local Time = game.ReplicatedStorage.Time
local timeText = game.ReplicatedStorage.TimerText
local textLabel = game.StarterGui.ScreenGui.TextLabel
local player = game.Players.LocalPlayer
Time.Value = 30
while true do
wait(1)
Time.Value = Time.Value -1
timeText = "Game starts in "..Time.Value.."s"
textLabel.Text = timeText
if Time.Value == 0 then
player.Character.PrimaryPart.Position = game.Workspace.Part.Position
break
end
end
This is my original script it does count down but it doesn’t show in the gui
does this work?
you might need a delay to slow it
see if the time value changes
because of this.
you could access it the way I did and check.
The value instantly changes from 30 to 0 and my camera gets gltchy too
it gets teleported but my character stays at spawn location
add a task.wait at the bottom of the for loop
, and put a number u want
local Time = game:GetService("ReplicatedStorage"):WaitForChild("Time")
local player = game:GetService("Players").LocalPlayer
local timeText = game:GetService("ReplicatedStorage"):WaitForChild("TimerText")
local textLabel = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("TextLabel")
Time.Value = 30
while true do
task.wait(1)
for i = Time.Value, 0, -1 do
print("done") -- print?
Time.Value= i
textLabel.Text = "game starts in "..i.."s"
print(timeText.Value) -- print?
if Time.Value == 0 then
print("done") -- print?
player.Character.PrimaryPart.Position = game.Workspace.Part.Position
textLabel.Visible = false
break
end
task.wait(3) -- change 3 to desired number
end
end
Mind sharing a video of it? it could help
IT WORKS IT DOES COUNT DOWN AND SHOW THE GUI
but my camera still glitchy
i will send a video in a second
glad to hear.
I tested it. It’s because it’s under a while loop
. So it keeps teleporting you.
wait i don’t know how to send a video
Yes, it’s because of this.
First try it without a while loop.
Second, you could make a variable, something like this -
local Time = game:GetService("ReplicatedStorage"):WaitForChild("Time")
local player = game:GetService("Players").LocalPlayer
local timeText = game:GetService("ReplicatedStorage"):WaitForChild("TimerText")
Time.Value = 14
local inround = false
while inround == false do
task.wait(1)
for i = Time.Value, 0, -1 do
print("done") -- print?
Time.Value= i
print(Time.Value) -- print?
if Time.Value == 0 then
inround = true
print("done") -- print?
player.Character:PivotTo(game.Workspace.Part.CFrame)
break
end
task.wait(1.2) -- change 3 to desired number
end
end
This would run once, if you want to run it more, you’d have to set inround
to false somewhere else when needed.