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

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:

01player = game.Players.LocalPlayer
02getPlayer = Seat.Occupant:GetPlayerFromCharacter(player)
03player2 = player.Character.Humanoid
04Seat = script.Parent.DriveSeat
05 
06while true do
07wait(0.5)
08if Seat.Occupant == "Humanoid" then
09    player.InCar.Value = true
10else
11    player.InCar.Value = false
12end
13end

Old Code, i dont want to scan for seat anymore

01player = game.Players.LocalPlayer
02player2 = player.Character.Humanoid
03 
04while true do
05wait(0.5)
06if player2.Sit == true then
07    player.InCar.Value = true
08else
09    player.InCar.Value = false
10end
11end

also i meant to put that it should scan the seat my bad

0
not just look if the player is sitting down or not RobloxGameingStudios 145 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

solved by friend

Ad

Answer this question