Hello, I would like to get support in the following thing:
I need to do like if you have a tool called for example car key you can seat if you don’t have that tool you will not be able to seat.
I’ve tried searching in the devforum, YouTube and even in google but I don’t find any tutorial and I think any scripted could help me as I think it’s not a very complex thing.
If any of would be able to help me I would be more than pleased!
local YourToolName = "CarKey"
script.Parent:GetPropertyChangedSignal("Occupant"):Connect(function()
if script.Parent.Occupant == nil then return end
local Humanoid = script.Parent.Occupant
local Character = Humanoid.Parent
local Player = game.Players:GetPlayerFromCharacter(Character)
if Humanoid then
local Tool = Character:FindFirstChild(YourToolName) or Player.Backpack:FindFirstChild(YourToolName)
if not Tool then Humanoid.Sit = false return end
end
end)