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
#Shop
1 messages · Page 1 of 1 (latest)
** You are now Level 3! **
I think its a normal script
you dont have the character
you’re trying to get the player from an individual part
just do it in a local script inside startergui
hit.Parent:GetPlayerFromCharacter()
event:FireClient()
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
you can if u have the character
game:GetService("Players"):GetPlayerFromCharacter(character)
like how tornadox did it
okay so what would you/ you guys say the best way to make it work would be?
ur getting the ui from the starter ui
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