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 4 years ago
Edited 4 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:

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

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

1 answer

Log in to vote
0
Answered by 4 years ago

solved by friend

Ad

Answer this question