A UI that says “toggle speed” If you own the Double Speed Game Pass you can toggle on to go faster and toggle off to walk around normally. If you don’t own the Game Pass if you click the button you’ll be prompt to purchase it. (Does that make sense?)
What is the issue?
I don’t know how to code this and I can’t hire a scripter.
Gui = path.to.gui.here -- e.g. game:GetService("ServerStorage").SpeedGui
local function playerSpeedGui(player)
local playerOwnsGamepass
-- find out if the player owns the gamepass
-- set "playerOwnsGamepass" to whatever it should be
if playerOwnsGamepass then
Gui:Clone().Parent = player.PlayerGui
end
end
game:GetService("Players").PlayerAdded:Connect(function(player)
-- We need another function here because CharacterAdded gives us
-- the character and that isn't very helpful when we want to check
-- if the owner has a gamepass
player.CharacterAdded:Connect(function()
playerSpeedGui(player)
end)
end)
Essentially, what you want to do is:
On player spawn, check if player owns the gamepass
local MarketplaceService = game:GetService('MarketplaceService')
local Player = game:GetService('Players').LocalPlayer
local PassId = 0 -- Gamepass ID
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,PassId) then -- If they own the gamepass, then
Player.Character:WaitForChild('Humanoid').WalkSpeed = 20 -- Walkspeed
else -- Otherwise
MarketplaceService:PromptGamePassPurchase(Player,PassId) -- Prompts gamepass
end
end)