|
The timer is ticking no matter what, and once it reaches 0 it gives you an award. Could someone give me an example please of how this is done? |
|
|
I should of asked this earlier, I did not know everyone was asleep. (Not trying to be rude) |
|
|
naw, they just don't know. |
|
|
How long waiting time do you imagine? Minutes, days, weeks? |
|
|
I was thinking day or just half a day like 12 hours. |
|
|
timer = 1000 --set to ur starting time
BadgeId = 0 --Your badge id
function subtract()
timer = timer - 1
end
print("starting countdown")
print(timer)
while timer > 0 do
wait(1)
subtract()
print(timer)
end
Pretty much this.
|
|
|
Add a function giving the badge or I can add it in for you too.
>_> |
|
|
^ For a waiting time of a day/ half a day the server probably will shutdown after some time. |
|
|
Not at all. I'm sorry, that really isn't close to what I described. |
|
|
i dont get what
"The timer is ticking no matter what"
means |
|
|
Loleris is the only one who can code a timer as perfect as what op is asking for. |
|
|
|
That isn't that difficult |
|
|
|
@BloodLitch101, yeah that's actually accurate to what I was looking for, but no one seems to know how to do it. I asked help once like 4 months ago now again hoping someone just 1 person could help me out. |
|
|
Well
Just use DataStores, :Tick() and some maths.. |
|
|
I know, I know I have to use datastore and tick(). I honestly do. But, I can't think of how to put it together. I just need a small example. |
|
ash877Join Date: 2008-02-18 Post Count: 5142 |
If you're talking login bonus stuff then look up os.time; nuff' said. |
|
|
TIME_BETWEEN_POINTS = 43200 --Seconds; 43200 is 12 hours
store = game:GetService("DataStoreService"):GetDataStore("TimeUntilReward")
game.Players.PlayerAdded:connect(function(p)
value = Instance.new("BoolValue",p)
value.Name = "newjoin"
value.Value = false
if store:GetAsync(p.Name) then
lasttime = store:GetAsync(p.Name)
t = math.floor(tick())
if t-lasttime > TIME_BETWEEN_POINTS then
else
seconds = TIME_BETWEEN_POINTS-(t-lasttime)
minutes =seconds/60
h.Text = "Come back in "..math.ceil(minutes).." minutes to receive a reward!"
end --
else
end
end)
game.Players.PlayerRemoving:connect(function(p)
if p.newjoin.Value == true then
t = math.floor(tick())
store:SetAsync(p.Name,t)
end
end)
insert the things u want to happen in between |
|
|
@Vendicular, you should have helped him without using a free-model. |
|
ash877Join Date: 2008-02-18 Post Count: 5142 |
@vendicular
he wants the time to constantly count down. Your script saves/loads and looks like it works but doesn't countdown. |
|
|