I'm making a game, and I wanted to make a game pass for it. I created a part and made a keycard shape and then watched a few videos to learn how to do it. None of them worked. Basically what I've done is I've saved the model of my keycard, and I've also created the game pass. I just need help making a script that works and does the following:
Checks if the game pass has been bought by a player joining the game. If it has, then give the tool to the player. If not then just do nothing and they don't get the tool.
Hopefully, someone has a solution for this because I'm new to scripting.
create a Folder inside of game.ServerStorage named "PassTools"
put all the tools you want to give to the player when he joins the server
put this script in ServerScriptService
local passId = 0 -- replace with pass id local toolFolder = game.ServerStorage.PassTools local passServ = game:GetService("GamePassService") function GiveToolsToPlayer(player) if passServ:PlayerHasPass(player, passId) then player:WaitForChild("StarterGear") player:WaitForChild("Backpack") for _,tool in pairs(toolFolder:GetChildren()) do tool:Clone().Parent = player.StarterGear tool:Clone().Parent = player.Backpack end end end game.Players.PlayerAdded:connect(onPlayerAdded)