local mouse = game.Players.LocalPlayer:GetMouse()
local players = game:GetService("Players")
...
local target = mouse.Target
local humanoid = target.Parent:FindFirstChild("Humanoid")
print("Hello")
if humanoid then
print("Humanoid trovato bae")
local character = humanoid.Parent
local nomeplayer = players:GetPlayerFromCharacter(character)
print(nomeplayer)
local playergui = nomeplayer:FindFirstChild("Playergui")
print(playergui)
end
end
end)
I tried to get a player with my mouse, check if he is a humanoid, then I got his name and now I wanted to get into his playergui, It gave me NIL as print(playergui) so I tried to change "PlayerGui" to BackPack and it worked. Can you help me?

4 comments
Might you please help me doing this? I'm not that good in Remote Events.
Sure! In your game add a RemoteEvent in ReplicatedStorage then in the script locate it "local event = game.ReplicatedStorage.RemoteEvent" then in your script where you put print(playergui) do "event:FireClient(player)" then in a local script do the event.OnClientEvent function with your code inside (accept answer if this was helpful)
Alright, look at my answer.
I've posted the script here, please help me, it gives me Argument 1 missing error