If The Player Has Bought The Game Pass, He Has A Trail, I'm Trying to figure out how to do it but it's not working, what am i doing wrong?
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamePassID = ???? function onPlayerSpawned(player) local hasPass = false local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID) print("Has Game Pass for Gun") end) if not success then warn("Error while checking if player has pass: " .. tostring(message)) return end if hasPass == true then local Trail = game.ServerStorage["Trail"] game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) local plrTrail = Trail:Clone() plrTrail.Parent = char.HumanoidRootPart if char:FindFirstChild("UpperTorso") then plrTrail.Attachment0 = char.Head.FaceFrontAttachment plrTrail.Attachment1 = char.Torso.RootRigAttachment else plrTrail.Attachment0 = char.Head.FaceFrontAttachment plrTrail.Attachment1 = char.Torso.WaistBackAttachment end end) local character = script.Parent.Parent.Parent end) end end game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function() onPlayerSpawned(player) end) end) Players.PlayerSpawned:Connect(onPlayerSpawned)
Closed as Not Constructive by TheeDeathCaster
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?