there are two of the bellow scripts one for each label. but for some reason the image for the drag label dosent change? why? and also why can i click and drag outside the label?
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local info = script.Parent.Parent.Parent.InvStats
local hold = info.Holding
local slot = info.Slot
script.Parent.MouseEnter:Connect(function()
if hold.Value == true then
local invslots = script.Parent.Parent:GetChildren()
for i, v in pairs(invslots) do
if v.Name == "InvSlot" then
if not v.SlotNumber.Value == slot.Value then
print(v.Name)
print(v.SlotNumber.Value)
if info.Occupid.Value == true then
if not v.SlotNumber.Value == script.Parent.SlotNumber.Value then
print(v.Name)
print(v.SlotNumber.Value)
local infoclone = v.Info.ItemTemplate:Clone()
infoclone.Parent = script.Parent.Info
v.Info.ItemTemplate:Destroy()
end
end
end
else
hold.Value = true
end
end
else
UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
hold.Value = true
slot.Value = script.Parent.SlotNumber.Value
info.Occupid.Value = script.Parent.Occupid.Value
info.Image.Value = script.Parent.Image
end
end)
end
end)
script.Parent.MouseLeave:Connect(function()
UserInputService.InputEnded:Connect(function(input)
local inputType = input.UserInputType
if inputType == Enum.UserInputType.MouseButton1 then
hold.Value = false
info.Occupid.Value = false
end
end)
end)
^^main script the one in each label^^
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
while true do
if script.Parent.Parent.InvStats.Holding.Value == true then
script.Parent.ImageLabel.Position = UDim2.new(0,mouse.X - 80,0,mouse.Y - 100)
script.Parent.ImageLabel.Visible = true
script.Parent.ImageLabel.Image = script.Parent.Parent.InvStats.Image.Value
else
script.Parent.ImageLabel.Visible = false
end
wait()
end
^^script that controls the label at the mouse vid : https://streamable.com/ak345k

2 comments
Meant to type 'use' instead of 'you' in the first sentence, my bad.
it dosent work in a gui