#How can i do this

82 messages · Page 1 of 1 (latest)

long slate
#

Idk

vivid hill
#

im confused

#

what is it that u are trying to do?

#

im confused about the player = ok part though

#

oh

#

is this in a local or server script

#

if you want to get a var for the player then you have to do a playeradded function

#
game.Players.PlayerAdded:Connect(function(plr)
  -- code
end)
keen meteorBOT
#

studio** You are now Level 1! **studio

vivid hill
#

plr would be referring to the player that just joined

#

what?

#

thats not a q lol

#

what is the problem

#

you shouldnt put the player added inside the touched event

#

are you giving points to the person in the car

#

what?

#

oh ok

#

when the touch event begins, check who is the occupant inside the car

#

and then find the player from their character

#

and then give the player points

#

inside the touched event

#

when it says "script.Parent" what is it referring to?

#

is the kill part part of the car

keen meteorBOT
#

studio** You are now Level 2! **studio

vivid hill
#

when the kill part is touched, get the occupant of the seat and then give them points

#

it depends where you put the numberValue for points in

#

if you put it inside leaderstats then yes

#

show the code

#

which line?

#

yeah ik

#

theres nothing wrong with that line

#

its because of the lines above

#

the getpropertychangedsignal function is kinda useless

#

since these lines of code will run in less than a millisecond and the occupant wont change in that time

#

it shouldnt work

#

all you have to do is get the occupant of the seat

#

wait lemme try this myself

#

do you have a variable for the seat?

keen meteorBOT
#

studio** You are now Level 11! **studio

vivid hill
#

you first need to get the character if you want to get the player

ornate leaf
#

hello, try local kills = game.Players.ok.leaderstats.Kills
kills.Value = 1

vivid hill
#
seat.Occupant.Parent
#

i got the character from doing this

#

what were you doing?

#

you should do ```lua
local character = seat.Occupant.Parent
local plr = game.Players:GetPlayerFromCharacter(character)

ornate leaf
#

ok its is your nickname?

vivid hill
#

trying to get the player who is sitting in a car

#

yes

#

bro it really aint that deep

#

he already had one before posting this

#

oh

#

what are the errors?

#

bro who are you?

#

tell me the error

keen meteorBOT
#

studio** You are now Level 3! **studio

vivid hill
#

ik why

#

you first have to check if their actually is an occupant in the seat

#

do ```lua
if seat.Occupant then
-- code
end

#

?

#

into what?

#

can you show the current code so i can check

#

yeah

#

wait no

#

actually try it

#

yeah ok

keen meteorBOT
#

studio** You are now Level 2! **studio

vivid hill
#

TELL ME THEM

#

dude can you pls leave

#

you aren't helping

#

what is on line 6

#

did you put that before or after checking if the seat has an occupant

#

because index nil means that what you are trying to find doesnt exist

#

actually gonna report you bro

#

you shouldnt be disrupting stuff like this

#

just annoying

#

you're trolling

#

👍

#

mark the post as solved

#

cant you like edit it

#

and then add the solved thing

#

bye!