Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Walkspeed Gamepass dont work or stay permanent?

Asked by 6 years ago

added the characteradded function to make it permanent, but it still refuses to work?

01local MarketplaceService = game:GetService("MarketplaceService")
02local Players = game:GetService("Players")
03 
04local gamePassID = 836664 
05 
06game.Players.PlayerAdded:Connect(function(player)
07        player.CharacterAdded:Connect(function(character) --this will fire every time a player's character spawns
08        character:WaitForChild("Humanoid")
09        onPlayerAdded(player)
10 
11    local hasPass = false
12 
13    -- Check if the player already owns the game pass
14    local success, message = pcall(function()
15        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
View all 31 lines...
0
Erm, not sure if it'll help but it seems that you have indented your 'CharacterAdded' function too much. NoirPhoenix 148 — 6y
0
Forgot local player soo MarkHasReset 77 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Make sure the GamePass / Developer Product is purchased and then goto your script and make sure when the player has the gamepass then you will make the walkspeed higher, Example

WalkSpeed (GamePass): game.Players.LocalPlayer.Humanoid.WalkSpeed = 20 [Change to walkspeed amount]

WalkSpeed (Developer Product): game.Players.LocalPlayer.Humanoid.WalkSpeed = game.Players.LocalPlayer.Humanoid.WalkSpeed + 5 [Every time its purchased it will get higher]

Whole Script For gamepass

01local MarketplaceService = game:GetService("MarketplaceService")
02local Players = game:GetService("Players")
03 
04local gamePassID = 0000000  -- Change this to your game pass ID --
05 
06local function onPlayerAdded(player)
07 
08    local hasPass = false
09 
10    -- Check if the player already owns the game pass
11    local success, message = pcall(function()
12        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
13    end)
14 
15    -- If there's an error, issue a warning and exit the function
View all 28 lines...

If this doesn't Work Check the Roblox wiki! Theres better info there.

http://robloxdev.com/

0
i want it to be perm tho, this only works when they join, not when they die. GenericTM 2 — 6y
Ad

Answer this question