Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do you kick someone out of a seat if they don't have a gamepass? [closed]

Asked by 4 years ago

local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local Racer = script.Parent.Parent.Workspace["Pod Racer 1"]

local gamePassID = 8328613 -- Change this to your game pass ID local function onPlayerAdded(player)

local hasPass = false

-- Check if the player already owns the game pass local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) 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 == true then print(player.Name .. " owns the game pass with ID " .. gamePassID)

-- Assign this player the ability or bonus related to the game pass

end end

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

This is the script to check if they have the gamepass but I don't know how to allow them to use the vehicle if they have it, and how to kick them out if they don't have it.

0
stolen script and code block pls maumaumaumaumaumua 628 — 4y

Closed as Not Constructive by maumaumaumaumaumua and Ziffixture

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?