Hi, I have this script,
script.Parent.MouseButton1Click:Connect(function()
character = game.Players.LocalPlayer.Character
player = game.Players:GetPlayerFromCharacter(character)
player.Character.Humanoid.JumpPower = 75
player.Character.Humanoid.WalkSpeed = 40
player.Character.Humanoid.SpawnTime.Value = 5
player.Backpack:ClearAllChildren()
for _, _ in pairs (player.Character:GetChildren()) do if _.ClassName == ("Tool") then _:Destroy() end end
game.ReplicatedStorage.Weapons.Ace["Commercia0l Airliner"]:Clone().Parent = player.Character
wait(0.1)
script.Parent.Parent:Destroy()
end)
It's located in a local script, and I was wondering if there was a way to make a global counterpart.
The issue I'm having is that since the new version is in a global script, will all players see the effect?
Additionally, I can't seem to figure out a global alternative for "game.Players.LocalPlayer", which, in the script is what determines who clicked the gui and applies the effect to only them.

6 comments
Im not sure about the main question, but if you put "player" in the parentheses in line 1 then it should give you the player.
I'm having trouble making this script that usually resides in a local script to work in a global script. Additionally, I don't see any mention of 'player' in line 1, did you mean line 2?
So you want the code to be run for all player in the server?
Not exactly, I was wondering if it's possible for a global script to perform the same as this local script, as in a player presses a gui and only that player receives the effects.
What is wrong with getting the player from the LocalPlayer function?
Nothings wrong with that method. I'm simply asking if there is a way to accomplish this script in a global script rather than a local one.