Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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!

0
just use a touched event and destroy the gun ReallyUnikatni 68 — 4y
0
That won Mrmonkeyman120 65 — 4y
0
't work* Mrmonkeyman120 65 — 4y

1 answer

Log in to vote
0
Answered by
Syclya 224 Moderation Voter
4 years ago
Edited 4 years ago

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.

Ad

Answer this question