This is my script for my game, I want to create a trello board for a database. I want the format to be:
USERNAME:USERID
Each list will be named “(toolname) Database” and I want it to give the player a permanent tool instead of them buying the gamepass, etc. This can be used for some reasons like an error in the system, new accounts etc. I do not know how so If you can help me edit the script I can bind it and we can go through errors.
local button = script.Parent
local tool = game.ServerStorage.ToolName – Replace ToolName with the name of your tool in ServerStorage
local gamePassId = script.Parent.GamepassId
– Function to give the tool to the player
local function giveTool(player)
local toolClone = tool:Clone()
toolClone.Parent = player.Backpack
end
– Check if player owns the gamepass when they join the game
game.Players.PlayerAdded:Connect(function(player)
if game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId, gamePassId.Value) then
giveTool(player)
end
end)
– Check if player owns the gamepass when the game starts
for _, player in ipairs(game.Players:GetPlayers()) do
if game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId, gamePassId.Value) then
giveTool(player)
end
end
– Check if player owns the gamepass when they respawn or die
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId, gamePassId.Value) then
giveTool(player)
end
end)
end)
Property of Rapid_Gaming22