![]() |
Trying to make a Timer
Hello. I'm trying to make a countdown timer, but it doesn't seem to be working. I'm also not sure of the best way to go about it.
Here is what I have so far: PHP Code:
|
You have a double equals sign (which are for comparing values) in your timer assignments.
Reducing the timer should also either be this.timer --; or this.timer -= 1; |
In your onCreated() function, you are using the equality operator (==) to assign a value. This will not work. When assigning values to variables, use a single equality sign. This also applies to your onPlayerChats() function. Also, since you're setting this.timer (you might want to change the name as well, I bet that's reserved) in onPlayerChats(), it seems a bit redundant to also do that in onCreated().
Next, you'll want to decrement a variable by using either of these two methods: PHP Code:
|
PHP Code:
|
Thank you guys! :)
|
| All times are GMT +2. The time now is 08:26 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.