- What do you want to achieve? Keep it simple and clear!
I trying to make a trail script. So, when player join the game. The server will check if the player own the gamepass from their userID. If the player owns the gamepass then there will be a trail attached to their HumanoidRootPart and when they walk a color will follow them.
- What is the issue? Include screenshots / videos if possible!
the trail doesn’t come out of the HumanoidRootPart
even though I own the gamepass. I publish and tried it in game but I’m still having the same problem and there isn’t any error in the output.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried doing some research on google and the developer forum but couldn’t find a way to fix it.
- Script in ServerScriptService
- Trail in ServerStorage
local MarketplaceService = game:GetService("MarketplaceService")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if (MarketplaceService:UserOwnsGamePassAsync(player.UserId, 18545042)) then
local Trail = game.ServerStorage.Trail:Clone()
Trail.Parent = char.Head
local attachment0 = Instance.new("Attachment")
attachment0.Parent = char.Head
attachment0.Name = "Attachment0"
local attachment1 = Instance.new("Attachment")
attachment1.Parent = char.HumanoidRootPart
attachment1.Name = "Attachment1"
Trail.Attachment0 = attachment0
Trail.Attachment1 = attachment1
end
end)
end)
I would really appreciate if someone could help me