Displaying trail behind players that own gamepass, disable on click?
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"
01 | local h = game.ServerStorage.SpeedDemonTrail |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if Debounce = = false then |
07 | script.Parent.Text = ( "DemonTrail - OFF" ) |
11 | script.Parent.Text = ( "DemonTrail - ON" ) |
The second script was the one I followed a tutorial to do and it creates a trail for the player
02 | local Trail = game.ServerStorage [ "SpeedDemonTrail" ] |
04 | game.Players.PlayerAdded:Connect( function (plr) |
05 | plr.CharacterAdded:connect( function (char) |
06 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(game.Players [ char.Name ] .UserId, id) then |
07 | local plrTrail = Trail:Clone() |
08 | plrTrail.Parent = char.Torso |
09 | plrTrail.Attachment 0 = char.Head.FaceFrontAttachment |
10 | plrTrail.Attachment 1 = char.Torso.WaistBackAttachment |