I am attempting to make a car anti-theft so people cant steal it. I have to use a onTouched to make it work but it messes up other code parented into the seat
heres the code:
local seat = script.Parent
local car = seat.Parent
local carowner = seat.CarOwner
function onTouched(part)
if part.Name == "Left Leg" then
local h = part.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
carowner.Value = h.Parent.Name
end
end
end
script.Parent.Touched:connect(onTouched)

6 comments
I don't see any problems here. What script is not working because of this?
its just another script in the vehicle seat. the other one doesnt even have a onTouched in it!
its a OnTouched script, meaning its mostly likely to block (mask) other scripts, or run its script 1st.
ah. that makes sense
Use a debounce system as it is probably due to overflowing
yeah that was the problem gg