I am working on a script for Changing a players speed for 180 seconds (3 minutes) that is bought with a developer product so i has to be bought over and over. Here is my script for buying the product:
local productId = (Id goes here) -- change to your developer product ID
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
I have the script for changing the speed here:
if local player = game.Players.LocalPlayer ProductPurchase = true then
local player = game.Players.LocalPlayer.Speed = 20
wait (180)
local player = game.Players.LocalPlayer.speed = 16
end
If i combind them like this:
local productId = (Id goes here) -- change to your developer product ID
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
and if local player = game.Players.LocalPlayer ProductPurchase = true then
local player = game.Players.LocalPlayer.Speed = 20
wait (180)
local player = game.Players.LocalPlayer.speed = 16
end
Would that work or is this script broken really bad?

1 comment
Actually the player needs to buy the developer product in order to get the 3:00 speed boost.