I made a script so that my donators could get VIP trails but it doesn't seem to work, can anyone see why?
This is where the parts for the script is. Eg the trail and script itself. http://imgur.com/gallery/D6Ezu
This is the script.
local passIDs = {
971425430;
000000000
}
function playerHasPass(plr)
for _,id in pairs(passIDs) do
if game.MarketplaceService:PlayerOwnsAsset(plr, id) then
return true
end
end
return false
end
script.Parent.Touched:connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if playerHasPass(plr) then
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char.Head
local attachment0 = Instance.new("Attachment",char.Head)
attachment0.Name = "trailAttachment0"
local attachment1 = Instance.new("Attachment",char.Torso)
attachment1.Name = "TrailAttachment1"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
end)
end)
else
print ("Player doesnt have the pass")
end
end
end)
I'm not very good with scripts, so if anyone could find out, could you send me a script fix and a explanation please?
