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

a way to disable tools when on a seat?

Asked by 4 years ago

I want to make it so if a player jumps on a seat it will disable his tools and they can't equip them. ( I'm trying to make a realistic car game) please and thank you!

1 answer

Log in to vote
0
Answered by 4 years ago

an easy and simple way to do this is by using Humanoid:UnequipTools()

this will unequip any tool the player has equipped, so what you can do is put it in a while true do loop. so whenever the player tries to equip a tool it gets unequipped immediately.

while true do
wait()
local char =  --path to your character--
local hum = char.Humanoid
hum:UnequipTools()
end

this is a super simple solution and feel free to add additional code to your liking. you can also use Humanoid.Seated to detect if a player is sitting in a seat.

Ad

Answer this question