I am currently having trouble with my gamepass UI I made. Basically the gamepass UI has a buy section and a receive section. So you can buy the pass in game or if you already bought it you can receive it manually.
What my problem is, is that it lets anyone receive a gamepass tool, whether or not you bought the gamepass. Basically my goal is for my UI to replace the automatic gamepass giver script to prevent the backpack from having too many tools at one time. But I can’t exactly use it if it’s letting people receive it for free. Any help?
Code in my Script
local id = 2929299 game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, id) then print(player.Name .. " has the game pass!") else print(player.Name .. " doesn't have the game pass...") end end) local gamePassValidator = game.ReplicatedStorage:WaitForChild("GamePassValidator") you=script.Parent.Parent.Parent.Parent.Parent.Parent script.Parent.MouseButton1Click:connect(function() if script.Parent.Selected==false then if game.Lighting:findFirstChild("WarAxe") then Tool=game.Lighting.WarAxe:clone() Tool.Parent=you.Backpack script.Parent.Selected=true wait(500) script.Parent.Selected=false end end end)