- What do you want to achieve?
I want to have the position and name of a badge stored in a table with an infinite amount of other groups of name and position.
- What is the issue?
I have no clue how to group values in the table
- What solutions have you tried so far?
Just made a table lol
Here is all the code in the script
local frame = script.Parent.Parent.userInterface.badgeFrame
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local inFrame = false
local shadow = Instance.new("TextLabel")
local shadow = Instance.new("TextLabel", script.Parent.Parent.userInterface.badgeFrame)
shadow.Size = UDim2.new(0,50,0,50)
shadow.Text = ""
shadow.BackgroundColor3 = Color3.new(0, 0.666667, 1)
shadow.AnchorPoint = Vector2.new(.5,.5)
shadow.Visible = false
local badges = {}
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
local absPos = frame.AbsolutePosition
local badge = Instance.new("TextLabel", script.Parent.Parent.userInterface.badgeFrame)
badge.Size = UDim2.new(0,50,0,50)
badge.Text = ""
badge.BackgroundColor3 = Color3.new(0, 0.666667, 1)
badge.AnchorPoint = Vector2.new(.5,.5)
badge.Position = UDim2.new(0,mouse.X-absPos.X,0,mouse.Y-absPos.Y)
print(badge.Position)
end
end)
frame.MouseEnter:Connect(function()
inFrame = true
shadow.Visible=true
while wait() do
local absPos = frame.AbsolutePosition
shadow.Position = UDim2.new(0,mouse.X-absPos.X,0,mouse.Y-absPos.Y)
if inFrame == false then
break
end
end
end)
frame.MouseLeave:Connect(function()
inFrame = false
shadow.Visible=false
end)