I'm making a car game and I want to make a script that will jump someone if they weren't the first person to sit in the car. How do I do that?
COMMUNITY QUESTION
How to make a seat that only first person who sat can sit in?
1 answer
Try this:
local car = script.Parent
local seat = car.Seat
local playerwhosatfirst
seat:GetPropertyChangedSignal('Occupant'):Connect(function(hum)
if not playerwhosatfirst then
playerwhosatfirst = game.Players:GetPlayerFromCharacter(hum.Parent)
elseif playerwhosatfirst and playerwhosatfirst ~= game.Players:GetPlayerFromCharacter(hum.Parent) then
hum.Jump = true
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
