Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

sitting not a value of vehicle seat error?

1 answer

https://developer.roblox.com/api-reference/property/Seat/Occupant

Occupant is a property of seats. It will have the Humanoid Object that is seated in it. With this, you can use the PlayersService to convert this Humanoid into a Player Object and change their leaderstats.

local humanoidSeated = Seat.Occupant
local characterSeated = humanoidSeated.Parent --the humanoid's parent is the character
local playerSeated = game.Players:GetPlayerFromCharacter(characterSeated)
--change leaderstats accordingly

1 comment

0

so, this fixed the ".... not a value of vehicle seat" error, but now i get the error "attempt to index global 'seat' (a nil value)"

This discussion is preserved as it was. New answers, comments, and votes are closed.