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: I can't find the error

Previous Thread :: Next Thread 
DeGames is not online. 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 is not online. 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
DoctorDarkMagic is not online. DoctorDarkMagic
Joined: 27 Dec 2013
Total Posts: 292
21 Sep 2015 06:11 PM
while wait(1) do
-- code
end


Dr Darky Magic
Report Abuse
AdministratorRights is not online. AdministratorRights
Joined: 19 Sep 2015
Total Posts: 85
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
DoctorDarkMagic is not online. DoctorDarkMagic
Joined: 27 Dec 2013
Total Posts: 292
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 is not online. 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
AdministratorRights is not online. AdministratorRights
Joined: 19 Sep 2015
Total Posts: 85
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 is not online. 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
DoctorDarkMagic is not online. DoctorDarkMagic
Joined: 27 Dec 2013
Total Posts: 292
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 is not online. 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
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