How would I make a script that would run another script for that person if they own a gamepass or be a certain user?
It's simply just an if statement and pieces of code. Here's some articles from Roblox that should help you find a solution: https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync / https://developer.roblox.com/en-us/api-reference/property/Player/UserId
You would use something like this, to check if they are a certain person:
local userids = { 1234567, 8901234, } game.Players.PlayerAdded:Connect(function(player) for i, v in pairs(userids) do if player.UserId == v then local script = game.ReplicatedStorage:FindFirstChild("script") script:Clone().Parent = player.PlayerScripts end end end)
and you could use something like this to check if they have the gamepass
local MS = game:GetService("MarketplaceService") local GamepassId = 1234567 game.Players.PlayerAdded:Connect(function(player) if MS:UserOwnsGamePassAsync(player.UserId, GamepassId) then local script = game.ReplicatedStorage:FindFirstChild("script") script:Clone().Parent = player.PlayerScripts end end)
EDIT: to put the sword in someone's inventory you might do something like
local script = game.ReplicatedStorage:FindFirstChild("script") script:Clone().Parent = player.PlayerScripts