Can someone help fix my script?

So basically, what I am trying to do is open a GUI for another player when the guy with the tool clicks.
Pictures of the script inside the tool:


I would really appreciate your guys help Thank you!

Can you show me a video how you play the script so I can see what’s wrong?

i think eyes might only enable for one person. also, check if things in screengui ‘eyes’ are visible or not.

Instead of Eyes.Enabled = true , Enable The Eyes GUI In StarterGui , the visibility of everything you don’t want the player to see on default should be set to false , then you should replace Eyes.Enabled = true with Eyes.Instance.Visible = true , Instance is whatever you want to make visible in the GUI


How can i fix it?

image

It doesn’t look as though that the “EyesGui” is visible to the client, can you double check where that is Parented to?

The EyesGui is under StarterGui.

Hm, try replacing local Eyes with this instead?

local Player = game.Players.LocalPlayer
local Eyes = Player.PlayerGui:WaitForChild("EyesGui")

Use Activated when clicking with a tool.

Change from line 1 to 8 to this:

local Player = game:GetService("Players").LocalPlayer
Char = Player.Character or Player.CharacterAdded:Wait()
EyesGui = Player:WaitForChild("PlayerGui"):WaitForChild("EyesGui")

script.Parent.Activated:Connect(function()
for i,M in pairs(workspace:GetChildren()) do
	if M:FindFirstChild("Humanoid") and M:FindFirstChild("HumanoidRootPart") and M ~= Char then

and removed the excess ends.

And thank you i will try this aswell

Its not giving me any errors but its not showing u[p.