I'm confused on how to fix my shop thingy, so basically when I play the game. I can purchase trails but when I purchase more than one trail the other one doesn't get deleted and it gets quite glitchy, can anyone fix this for me please? (The wantedtrails are remoteevents and don't worry about the leaderstats, I only want the double trail problem fixed) First script:
wantedtrail = nil
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Rebirths.Value >= 1 then
wantedtrail = "WhiteTrail"
game.Players.LocalPlayer.leaderstats.Rebirths.Value = game.Players.LocalPlayer.leaderstats.Rebirths.Value - 1
workspace.Events.Trail:FireServer(wantedtrail)
end
end)
Second Script:
wantedtrail = nil
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Rebirths.Value >= 2 then
wantedtrail = "RedTrail"
game.Players.LocalPlayer.leaderstats.Rebirths.Value = game.Players.LocalPlayer.leaderstats.Rebirths.Value - 2
workspace.Events.Trail:FireServer(wantedtrail)
end
end)
