I'm still learning how this work and trying my best. I can't do this by myself so I followed some tutorials and did some basic editing myself.
The first script is a script that I have inside a textbutton/gui. Some players that own the gamepass simply don't want to have the trail behind them. "SpeedDemonTrail" is the trail in serverstorage and I tried to make it so when the player clicks the button, it disables the trail but it says "SpeedDemonTrail is not a member of server storage"
local h = game.ServerStorage.SpeedDemonTrail
local Debounce = false
script.Parent.MouseButton1Click:Connect(function()
if Debounce == false then
h.Enabled = false
script.Parent.Text = ("DemonTrail - OFF")
Debounce = true
else
h.Enabled = true
script.Parent.Text = ("DemonTrail - ON")
Debounce = false
end
end)
The second script was the one I followed a tutorial to do and it creates a trail for the player
local id = 8309369
local Trail = game.ServerStorage["SpeedDemonTrail"]
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:connect(function(char)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
local plrTrail = Trail:Clone()
plrTrail.Parent = char.Torso
plrTrail.Attachment0 = char.Head.FaceFrontAttachment
plrTrail.Attachment1 = char.Torso.WaistBackAttachment
end
end)
end)

8 comments
does an Object named 'SpeedDemonTrail' exist inside the serverstorage? If it does, then try using WaitForChild.
It does exist inside ServerStorage. However when I hit play the first error I receive it's telling me "Blah SpeedDemonTrail is not a member of server storage". However everything else works properly
Try doing, game.ServerStorage:WaitForChild('SpeedDemonTrail')
19:36:18.058 - Infinite yield possible on 'ServerStorage:WaitForChild("SpeedDemonTrail")'... Just got that while doing what you said
Could the issue possibly be that the trail is attached to the player and no longer exists in server storage by the time I try to enable/disable it?
That means that there is no object named SpeedDemonTrail inside the ServerStorage, are you sure SpeedDemonTrail is the exact name?
Yes, I am 100% sure. Thing is that the script on the bottom needs to find SpeedDemonTrail in serverstorage. It finds the trail and displays the trail behind the player. However the script that enables and disables the trail says "SpeedDemonTrail" is not a valid member... when I click it but the spelling and names its the same
Well. Not when I click it but when I hit play it displays the trail behind the player, as meant to be. But when I click to disable, nothing happens. I open the script giving the error and says: 19:48:47.753 - SpeedDemonTrail is not a valid member of ServerStorage... However the other script uses the same line to find the trail in server storage and doesn't give the same issue?