I got a trail game pass script that, is not working? Could someone tell me whats wrong?
--Put in a script in ServerScriptService
local passId = 4916610
local MPS = game:GetService("MarketplaceService")
local function isAuthenticated(userId, gamePassId) -- define outside the PlayerAdded event
return MPS:UserOwnsGamePassAsync(userId, gamePassId)
end
game:GetService("Players").PlayerAdded:Connect(function(plr) -- :connect is deprecated, use :Connect
plr.CharacterAdded:Connect(function(char) -- wait for the character!
if isAuthenticated(plr.UserId, passId) then
local Trail = game.ServerStorage["Red 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)
end)

3 comments
are you sure this is a serverscript in serverscriptservice.. because you're defining character as script.Parent.Parent.Parent
I don't really know much about scripting, if so what will I have to do to make sure its a server script?
A server script looks like a white scroll. A local script looks like a scroll with a blue person on it.