DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 21 Sep 2015 05:48 PM |
countDownInt is an IntValue and starts 10 and every second being -1 by another script
local Player = game.Players.LocalPlayer local Countdown = Player.PlayerGui:WaitForChild("CountdownGui") local CountdownText = Countdown:WaitForChild("TextLabel")
local CountDownInt = game.Workspace:WaitForChild("countDownInt")
CountDownInt.Changed:connect(function() CountdownText.Text = CountDownInt.Value end)
Works until VVV
if CountDownInt.Value == 0 then script.Parent:TweenPosition(UDim2.new(0.9, 0,0.5, 0)) end |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 21 Sep 2015 06:10 PM |
| Does if statements not work like that? so confused |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2015 06:11 PM |
while wait(1) do -- code end
Dr Darky Magic |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2015 06:14 PM |
local player = game.Players.LocalPlayer local countdown = Player.PlayerGui:WaitForChild("CountdownGui") local countdowntext = Countdown:WaitForChild("TextLabel")
-- you dont need to make an int value, use for i= do
local i = 10 wait(1) while i > 0 do wait(1) i = i - 1 countdowntext.Text = i end |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2015 06:16 PM |
That might work :/
Sorry if mine didn't. I'm not exactly awake O.O
Dr Darky Magic |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 21 Sep 2015 06:17 PM |
I want the server to have its own countdown timer and having the player's local scripts to reference to it because if the action is done in the player it wouldn't work with multiple players.
That part works, the part that doesn't work is the if statement. |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2015 06:18 PM |
@DeGames
Just make the Gui a "server sided gui" so to speak. make the script a ServerScript, and just change the countdown from there by editing my script. |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 21 Sep 2015 06:18 PM |
local Player = game.Players.LocalPlayer local Countdown = Player.PlayerGui:WaitForChild("CountdownGui") local CountdownText = Countdown:WaitForChild("TextLabel")
local CountDownInt = game.Workspace:WaitForChild("countDownInt")
CountDownInt.Changed:connect(function() CountdownText.Text = CountDownInt.Value
if CountDownInt.Value == 0 then script.Parent:TweenPosition(UDim2.new(0.9, 0,0.5, 0)) end end
Red Blossoms |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2015 06:18 PM |
Is the local script in the Gui? If so, that should work for all players as the script moves to the Gui.
Dr Darky Magic |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 21 Sep 2015 06:22 PM |
| ok thanks, yeah it was that the function override anything else that would happen in the script. |
|
|
| Report Abuse |
|
|