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

How to get a players name from a seat? [closed]

Asked by 5 years ago

Making a script that requires the name of the player who is sitting in a certain seat

0
When you sit on a VehicleSeat or Seat it creates "SeatWeld" within the seat, its Part1 property links to HumanoidRootPart of the player's character. SeatWeld.Part1.Parent.Name Scriptulus 30 — 5y
0
this isnt a script request site, come with a script of your own that doesnt work as intended and then we'll help, the person below is not supposed to answer, instead do a little bit of research Gameplayer365247v2 1055 — 5y

Closed as Not Constructive by DeceptiveCaster

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

you could check for the current player by using the seat's Occupant property, which holds the humanoid of the player that's sitting down:

Example: note: this only works when someone is sitting down on the seat; i recommend having some sort of event that detects when the seat is occupied

local seat = workspace.car.seat -- change this to directory of the desire seat object
local character = seat.Occupant.Parent
if character.Name == "bleh" then
    print("hello there "..character.Name)
end

I really recommend checking out properties of roblox objects by going to Roblox API refrence. this will help you learn more on your own

Ad