Hey, this might be an easy question to be answered.
Lets say that
player = "DanzLua"
How would I use the variable "player" (which is causing an error because it's a string value, i'm guessing) to get to get to game.Players.DanzLua
I tried
game.Players(player)
but that doesn't seem like the correct way to do this. Thanks.
Edit: Let me try to explain it a bit more. I have a StringValue with the value of "DanzLua" In a script there is a variable which is player=script.Player (Player is the name of the StringValue) I am trying to get to games.Players.DanzLua by using game.Players(player.Value)
Error: 17:13:50.503 - Workspace.FunnyMoon.Script:2: attempt to call field 'Players' (a userdata value) 17:13:50.503 - Stack Begin 17:13:50.504 - Script 'Workspace.FunnyMoon.Script', Line 2 17:13:50.504 - Stack End
Line causing error:
local player = game.Players(script.Parent.Player.Value)

1 comment
you should use [ ] instead of ( ) for the line causing error if you want to link something that requires the name from a reference.