I cant get this seat to change a player's value? [Solved By Friend]
Asked by
5 years ago Edited 5 years ago
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:
01 | player = game.Players.LocalPlayer |
02 | getPlayer = Seat.Occupant:GetPlayerFromCharacter(player) |
03 | player 2 = player.Character.Humanoid |
04 | Seat = script.Parent.DriveSeat |
08 | if Seat.Occupant = = "Humanoid" then |
09 | player.InCar.Value = true |
11 | player.InCar.Value = false |
Old Code, i dont want to scan for seat anymore
01 | player = game.Players.LocalPlayer |
02 | player 2 = player.Character.Humanoid |
06 | if player 2. Sit = = true then |
07 | player.InCar.Value = true |
09 | player.InCar.Value = false |
also i meant to put that it should scan the seat my bad