added the characteradded function to make it permanent, but it still refuses to work?
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamePassID = 836664 game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) --this will fire every time a player's character spawns character:WaitForChild("Humanoid") onPlayerAdded(player) local hasPass = false -- Check if the player already owns the game pass local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) end) -- If there's an error, issue a warning and exit the function if not success then warn("Error while checking if player has pass: " .. tostring(message)) return end if hasPass == true then print(player.Name .. " owns the game pass with ID " .. gamePassID) player.Character.Humanoid.WalkSpeed = 30 end end) end) game:GetService('Players').PlayerAdded:Connect(onPlayerAdded)
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
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamePassID = 0000000 -- Change this to your game pass ID -- local function onPlayerAdded(player) local hasPass = false -- Check if the player already owns the game pass local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) end) -- If there's an error, issue a warning and exit the function if not success then warn("Error while checking if player has pass: " .. tostring(message)) return end if hasPass == true then print(player.Name .. " owns the game pass with ID " .. gamePassID) game.Players.LocalPlayer.Humanoid.WalkSpeed = 20 end end -- Connect 'PlayerAdded' events to the 'onPlayerAdded()' function Players.PlayerAdded:Connect(onPlayerAdded)
If this doesn't Work Check the Roblox wiki! Theres better info there.
http://robloxdev.com/