The scripts I have been making in studio only actually work in solo mode, but they do not work online, I know the reason for this is because all of the scripts I have made are all based on 'Player', for example to make a players torso invisible:
game.Workspace.Player.Torso.Transparency = 1
How do I make it so that 'Player' is changed to any player on the servers username? For example, if I was on the server, the script would automatically change to:
game.Workspace.mrcool2.Torso.Transparency = 1
EDIT:
In an actual concept, I have a script which is used to change the properties of an item the player is holding in their hand when it interacts with the environment, so i need the script to be able to find the player in the workspace, to find said tool, for example,
game.Workspace.Player1.Torch.Fire.Enabled
My issue is including every player in the place of 'Player1' so that the script can pick up the item in any players hand, without their username having to be manually written down in the script.
I'm sorry if this is really badly explained, it's a quite a difficult concept to explain >_<

2 comments
Is this a localscript or a regular script? Can I get some context on what this script is?
this would be in a regular script, as most of my scripts involve detecting tools that the player is holding