Making a spell that will show all the player in map

Hello, Im making a potion that will show the players in the map, but the script is not working, No error in console.

Script:

    for i, v in pairs(plr.Character:GetChildren()) do
        print(i)
        local SurfaceUI = Instance.new("SurfaceGui", v)
        SurfaceUI.Face = "Front"
        SurfaceUI.Adornee = v
        SurfaceUI.AlwaysOnTop = true
        SurfaceUI.ResetOnSpawn = false
        SurfaceUI.Adornee = v
        
        ----------- Frame ----------------------
        
        local Frame = Instance.new("Frame", SurfaceUI)
        Frame.Visible = true
        
        

    end

You would be better off using a BillboardGui for this; with a surface GUI, if the player is facing away from you the guy wouldn’t be visible.

If I would add AlwaysOnTop I could see them.
And actually that is what I’m using in the script.

That is not the case. If you are not looking directly at the face in which the SurfaceGUI is set, you cannot see it.

Edit: You can try replicating in studio mode if you do not believe me.

Screen Shot 2021-04-03 at 5.20.19 PM

1 Like

Thanks, I thought about this and I want to do 1+1, I mean surfaceGUI + Billboard GUI.

But its still does not solve my problem…

Are you looping through all players? In the code provided you seem to be looping through only one character.

Oh yeah, for testing reasons because the source code wasnt working i used it in UI so i can use it how much times I want.