#Shop

1 messages · Page 1 of 1 (latest)

topaz ledge
#

Hey I'm making a game about trains and escaping the tunnels, not important but Im trying scripting I have very little knowledge about it but im trying to make it so when someone stands on the brick the UI that I made pops up. so what I did was I made a script in the block and this was the script anyone know what i did wrong? I tested if the script had any erros, and it did go to the print("player touched")
Anyone know what I did wrong

golden sealBOT
#

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

mint mica
#

is it a script or local script

#

@topaz ledge

topaz ledge
runic marsh
#

you’re trying to get the player from an individual part

mint mica
runic marsh
#

hit.Parent:GetPlayerFromCharacter()
event:FireClient()

mint mica
#

you can just do it totally client side 🤷‍♂️

#

but that works

torn bear
#

heyyy

#

You cant get a player from

#

Character’s leg or

#

Any part

#

So you should try looping to find the closest ancestor with character model

raven badger
#

like how tornadox did it

topaz ledge
#

okay so what would you/ you guys say the best way to make it work would be?

raven badger
raven badger
#

you need to get the player standing on it

#

by getting the part that touched it and then the parent of it

#

which is the character

#

and the do game:GetService("Players"):GetPlayerFromCharacter(character)

#

to get the player