I'm Trying To figure out how to do it but it's not working, can Someone give me a help, I want to script when player touches the brick and if he has the gamepass he gets a trail, Thanks!
game.Players.PlayerAdded:Connect(function(plr) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,5647766) then script.Parent.Touched:Connect(function(parttouched) local humanoid = parttouched.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then local char = humanoid.Parent local trail = game.ServerStorage.Blue:Clone() trail.Parent = char.Head local attachment0 = Instance.new("Attachment", char.Head) attachment0.Name = "TrailAttachment0" local attachment1 = Instance.new("Attachment", char.HumanoidRootPart) attachment1.Name = "TrailAttachment0" trail.Attachment0 = attachment0 trail.Attachment1 = attachment1 else print(plr.Name .. " player doesn't have game pass") end end) end end)