Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's wrong with this gamepass script that is supposed to give a trail?

Asked by 6 years ago

Here is a script that is suposed to give the player a trail but it does not work. Could anyone help me to fix it?

local passId = 1681075330

function isAuthenticated(player)
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(passId)
end

game.Players.PlayerAdded:connect(function(player)
    if isAuthenticated(player) then
        player.CharacterAdded:connect(function(char)
            local trail = game.ServerStorage.TrailToad:Clone()
            trail.Parent = char.Head
            local attachment0 = Instance.new('Attachment',char.Head)
            attachment0.Name = 'TrailAttachment'
            local attachment1 = Instance.new('Attachment',char.HumanoidRootPart)
            attachment1.Name = 'TrailAttachment1'
            trail.Attachment0 = attachment0
            trail.Attachment1 = attachment1
        end)
    end
end)

Answer this question