weradealer.blogg.se

How to get player from character roblox
How to get player from character roblox







how to get player from character roblox

Or, If you want to get the individual X, Y, Z co-ordinates local varX = .X Now if you want to access the player's properties, including position, you would do this in a regular script: local player = -Get's player object and stores it in 'player' variable You can rename or adjust that any way you see fit, or store the player object in any manner you wish. ' Data' is just a folder I put in the Workspace and ' Player' (Capital P) is an ObjectValue container I named ' Player' which I use to store the player object. In my case, only one player is on the server, but you can adapt the code to track other players as you see fit. This script fires when a player joins the game. The game I'm working on is a single player game, so I store the player object in an object container which I access whenever I need the value in any of my server side scripts.įor example: :Connect(function(player) This can be done be capturing the player object when they first load onto the server using a regular script somewhere in the Workspace. ( player.Character).īefore you can access the Character property, you need to get the player's object.

how to get player from character roblox

To get a player's position (server side) you need to access the player's character property. Roblox is very confusing, despite their claims that it is an easy way to learn scripting.









How to get player from character roblox