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)
Ok, alright so, the problem here is.. that you're trying to access ServerStorage through client.
what you instead want to do is, something like this.
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local Debounce = false script.Parent.MouseButton1Click:Connect(function() local h = char.Torso.SpeedDemonTrail 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)