Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I identify a player in this script?

I am trying to identify the player so I can get this script working, please help me out XD

I made my own datasave, so practically, player's file will only load if they are online and anything inside the player file will load when they play my game. This script is use for an exp bar to display how much exp you have or gained. Please help me out!

Script:

game.ServerStorage.StatFile.Player.statnumba.exp.Value

1 answer

Well if you have the player set as a variable we can use that to get its name and get to the value

local player = nil --change to the player

game.ServerStorage.StatFile:FindFirstChild(player.Name).statnumba.exp.Value

I used findfirstchild to find the file with the player's name

4 comments

0

here is the error I got using yours -> attempt to index local 'player' (a nil value)

0

@ericlor98 you didn't set the player variable

0

wdym by that that @DanzLua

0

@ericlor98 read line one man, Change To The Player

This discussion is preserved as it was. New answers, comments, and votes are closed.