How do I fix the infinite yield possible warning?
I'm trying to make a gamepass that gives you devil powers. The way I'm trying to do it is by making a folder in server storage and then putting all the local scripts for the powers in that and then cloning it into the player backpack.
Heres my code
ServerStorage = game:GetService("ServerStorage")
local id = 13229693
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
1 | if purchased and id = = ido then |
2 | plr.Character.Humanoid.WalkSpeed = 20 |
end)
game.Players.PlayerAdded:Connect(function(plr)
1 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(plr.UserId,id) then |
2 | game.Workspace:WaitForChild(plr.Name):WaitForChild( "Humanoid" ).WalkSpeed = 20 |
3 | local Devil = ServerStorage:WaitForChild( "Devil" ):Clone() |
4 | Devil.Parent = game.Players.LocalPlayer.BackPack |
end)