You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
– I want to give the player more speed if he has the GamePass. -
What is the issue? Include screenshots / videos if possible!
– When the Player reset his character his walk speed becomes normal -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
– I tried to make While loop to solve that but It doesn’t work and I face the same issue.
(I am new and learning so please help me)
Here is my code :
local MPS = game:GetService("MarketplaceService")
local GamePassId = 57627339
local Player = game.Players.LocalPlayer
local character = Player.Character
if not character or not character.Parent then
character = Player.CharacterAdded:Wait()
end
while true do
wait(1)
local HasPass = MPS:UserOwnsGamePassAsync(Player.UserId,GamePassId)
if HasPass == true then
if character.Humanoid.WalkSpeed ~= 50 then
character.Humanoid.WalkSpeed = 50
end
print(Player.Name.." has the Game Pass")
else
print(Player.Name.." does not has the game pass")
MPS:PromptPurchase(Player,GamePassId)
end
end