i have a script where when you position your mouse over any part that is lootable, it brings a textlabel to your mouse's position, and displays the name of the part. but for some reason it's not working. the script is located inside of a screengui. here is my script:
local plr = script.Parent.Parent.Parent
local Char = plr.Character
local label = script.Parent.TextLabel
local mouse = plr:GetMouse()
local Lootables = {"Small Stone", "Large Stone", "Gold"}
mouse.Move:connect(function()
if mouse.Target.Name == Lootables then
print(mouse.Target.Name)
label.Text = mouse.Target.Name
label.Position = UDim2.new(0,mouse.X,0,mouse.Y)
end
end)
I think the problem is in line 8.

1 comment
nothing to do with this bit why is player defined as parent parent parent