I want to make this function in my script only run for a player if they have a Gamepass.
local player = script.Parent
local trail = game.ReplicatedStorage.TrailMachine
function createMachine()
local trailClone = trail:Clone()
trailClone.PrimaryPart = trailClone.Core
trailClone.Parent = player
trailClone:moveTo(player.Torso.Position)
local weld = Instance.new("Motor6D")
weld.Parent = trailClone.Core
weld.Part0 = trailClone.Core
weld.Part1 = player.Torso
end
Any help would be appreciated

1 comment
I replaced "passID" with the gamepass id, but the function still isn't running.