hi, i'm having issues making a local script that scans if a player sits in the seat, i have also tried Occupant for the seat and that didn't work either, unless for some reason values in Explorer dont change during studio test mode, as i haven't coded what the InCar value does yet. the inCar value is for my drive to earn feature in my driving game.
I'm not very good at working with seats in Roblox yet, so if im doing something wrong tell me!
the while true do is to constantly scan if the player is in the seat.
My current local script in the car code: Edit Later:
player = game.Players.LocalPlayer getPlayer = Seat.Occupant:GetPlayerFromCharacter(player) player2 = player.Character.Humanoid Seat = script.Parent.DriveSeat while true do wait(0.5) if Seat.Occupant == "Humanoid" then player.InCar.Value = true else player.InCar.Value = false end end
Old Code, i dont want to scan for seat anymore
player = game.Players.LocalPlayer player2 = player.Character.Humanoid while true do wait(0.5) if player2.Sit == true then player.InCar.Value = true else player.InCar.Value = false end end
also i meant to put that it should scan the seat my bad