I need a Gui for my Pokemon game that opens up and offers the option of sending a battle request to the other player.
What I have so far:
local player = script.Parent.Parent
m = player:GetMouse()
m.Button1Down:connect(function()
if m.Target then
if m.Target.Parent then
local user = Game.Players:GetPlayerFromCharacter(m.Target.Parent)
if user and user ~= player then -- Checks to see if the player is clicking on another player
local c = user.Character
if (player.Character.Torso.Position - c.Torso.Position).magnitude < 20 then
local bg = Instance.new("BillboardGui",c.Head)
bg.Adornee = c.Head
bg.Size=UDim2.new(1,0,1,0)
bg.StudsOffset = Vector3.new(3,0,0)
bg.Name = "Interact"
game.Lighting.Interacting:Clone().Parent = bg
bg.Interacting.Text = user.Name
end
end
end
end
end)
Does not work. Please help.

2 comments
Please use the code block button on your code, this meaning we see the code in correct format.
I did. Can you help me?