When I run the command its suppose to exchange your points for minutes but instead I get
Infinite yield possible on 'Players.vhixloqan:WaitForChild("Mins")'
I really need help because I have no idea how to fix this.
game.Players.PlayerAdded:Connect(function(player) local leaderstats = player:WaitForChild("leaderstats") local Mins = player:WaitForChild("Mins") local Tokens = player:WaitForChild("Tokens") player.Chatted:Connect(function(msg) if player:GetRankInGroup(3942568) >=20 then if msg == ";exchange tokens" then if leaderstats.Tokens.Value >= 100 then leaderstats.Tokens.Value = leaderstats.Tokens.Value - 100 Mins.Minutes.Value = Mins.Minutes.Value + 120 end end end end) end)
I see what your mistake is, you are waiting for Mins and Tokens to be inside the player, not the leaderstats folder.
Here is the fixed version:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = player:WaitForChild("leaderstats") local Mins = leaderstats:WaitForChild("Mins") local Tokens = leaderstats:WaitForChild("Tokens") player.Chatted:Connect(function(msg) if player:GetRankInGroup(3942568) >=20 then if msg == ";exchange tokens" then Tokens.Value >= 100 then Tokens.Value = leaderstats.Tokens.Value - 100 Mins.Value = Mins.Value + 120 end end end end) end)