Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I identify a player in this script? [closed]

Asked by 7 years ago

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

Closed as Not Constructive by Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
7 years ago

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

0
here is the error I got using yours -> attempt to index local 'player' (a nil value) garbnothrow2 3 — 7y
0
@ericlor98 you didn't set the player variable DanzLua 2879 — 7y
0
wdym by that that @DanzLua garbnothrow2 3 — 7y
0
@ericlor98 read line one man, Change To The Player DanzLua 2879 — 7y
Ad