How do i go about creating a dev product to add time to a timer?

  1. What do you want to achieve?
    I have a game that i have created but i want to make a dev product that adds time to a timer that counts down.

  2. What is the issue?
    I would need to create a way to add time to a timer that resets every 30 seconds. After the player purchases the dev product, i have not figured out any way on how to add the time.

  3. What solutions have you tried so far?
    On / Off. I just have yet to find any way to create this and therefore cannot figure out what to even try.

My game changes the player’s character to a random player’s character every 30 seconds. I have wanted to create a dev product purchase that allows the player to buy more time since there is a count down. I do not know how to make a dev product that will change scripts to add the extra time.

Just to explain some stuff here:

I have two scripts. One changes the characters appearance every 30 seconds and the other one is a local script that affects a on screen timer so it goes down by one every second. Once the timer hits zero, it refreshes. If i were to add a extra seconds dev product, how could i make it so the dev product can affect both the on screen timer and actual timer that changes your avatar?

What do I want to get?
I would like to know any ways i may go about creating this.
Any help is appreciated

5 Likes

I am pretty new to scripting and I am currently building my first experience, but I did get a system up and running for this.

I created a script in server script service for “handling purchases” (see [Roblox guide]
(MarketplaceService | Documentation - Roblox Creator Hub)). From there, I connected bindable event to my server script where I handle the game time. Right after you name the time amount I created the function to add a certain amount of time once triggered from Handling purchases.

Hope that makes sense.

1 Like