Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I make players not equip any tools if a player is in the car seat?

So for my game I'm using the A-Chassis by Inspare. However, I want it to be that if the player is in the car seat they cannot see any tools and use no tools, how would I achieve this?

local script I have so far:

--// Variables
local car = script.Parent.Car.Value
local seat = car.DriveSeat
local StarterGui = game:GetService("StarterGui")
local player = game:GetService("Players").LocalPlayer
--// Script
if seat.Occupant then
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
	end

And the Gui enabled thing won't work I think because won't it disable everyone's gui? Anything helps!

3 comments

0

just use a touched event and destroy the gun

0

That won

0

't work*

1 answer

You could parent it to ex: the player itself and re-parent it back when you need it / when they leave the seat. Detect this using the occupant property. That's an option you could rely on.

Humanoid:UnequipTools() is also an option, just note that they can equip their tools after.

This discussion is preserved as it was. New answers, comments, and votes are closed.