Oh I got it yes now yes alright thank you
1 Like
Yea I just realized I had to add the name
1 Like
Again thank you so much you helped me in all I needed!
1 Like
local Game = game
local Script = script
local Debris = Game:GetService("Debris")
local Players = Game:GetService("Players")
local Seat = Script.Parent
local Tool = "Name" --Change this to the tool's name.
local function OnOccupantChanged()
local Occupant = Seat.Occupant
if not Occupant then return end
local Character = Occupant.Parent
if not Character then return end
local Player = Players:GetPlayerFromCharacter(Character)
if not Player then return end
local Backpack = Player:FindFirstChildOfClass("Backpack")
if not Backpack then return end
local Tool = Backpack:FindFirstChild(Tool) or Character:FindFirstChild(Tool)
if Tool then return end
local SeatWeld = Seat:FindFirstChild("SeatWeld")
if SeatWeld then Debris:AddItem(SeatWeld, 0) end
end
Seat:GetPropertyChangedSignal("Occupant"):Connect(OnOccupantChanged)
1 Like