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

Giving a folder to player without storing it in the player or character?

Asked by 4 years ago

How would I go about showing a script that a folder with belongs to a certain player, I tried doing this another way by naming the folder the players name, but this caused many issues. I also thought about storing it in the player/character, but it isn't very secure. Any suggestions?

0
Perhaps you could have a string value inside the folder indicating which player it belonged to, or maybe a int value for their player ID jediplocoon 877 — 4y
0
Think that might be the plan Feroxidus 83 — 4y

1 answer

Log in to vote
1
Answered by
crywink 419 Moderation Voter
4 years ago

Hey.

There's nothing really "insecure" about parenting a folder to the player; in fact, it's a pretty common method to storing player data. Although if you're opposed to it, here are a couple of other methods you can use...

1) You can create a module and keep a dictionary in it with all of the player data. It can be indexed with module.Data[game.Players.playername]. I recommend this method because it's pretty easy to do and allows you to store any data without having to create a specific value object. This can also be achieved using a normal table, but I'm assuming you would prefer a module because it can be accessed from other scripts without any hassle.

2) If you're opposed to parenting all of your objects to a folder named in correlation with players' names, you can parent them to an ObjectValue with its Value property set to the player object. This is also a pretty easy method to use, and to index it, you would have to iterate through the folder of values and find the one with the value that matches the player.

Remember to upvote and mark as answered if this helped you! If you see any false information, just let me know.

Thanks, Sam

Ad

Answer this question