#Gamepass Team Change

14 messages · Page 1 of 1 (latest)

eternal fiber
#
function Click(mouse)
    script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Slime green")
    script.Parent.Parent.Parent.Parent.Parent:LoadCharacter()
end

script.Parent.MouseButton1Down:Connect(Click)
#

how can i add that you need a gamepass to change the team.

eternal fiber
#

please help

sturdy siren
#

what

eternal fiber
ocean dragon
#

?

#

Once u try using this website you can never go back

#

Ooh look at this

#
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local passID = 0000000  -- Change this to your Pass ID

local function onPlayerAdded(player)
    local hasPass = false

    -- Check if the player already owns the Pass
    local success, message = pcall(function()
        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passID)
    end)

    -- If there's an error, issue a warning and exit the function
    if not success then
        warn("Error while checking if player has pass: " .. tostring(message))
        return
    end

    if hasPass then
        print(player.Name .. " owns the Pass with ID " .. passID)
        -- Assign this player the ability or bonus related to the Pass
    end
end

-- Connect "PlayerAdded" events to the function
Players.PlayerAdded:Connect(onPlayerAdded)
#

From the docs

#

Basically your answer dawg

#

Booyah

#

Just switch the code inside the if has pass with the team switching code