You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
the label teleports to the mouse constantly -
What is the issue? Include screenshots / videos if possible!
its far out for no good reason it seems
local craftgui = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("Crafting")
local options = craftgui:WaitForChild("Options")
local Cop = craftgui:WaitForChild("Coptions")
local label = game.Players.LocalPlayer.PlayerGui.MainGui.Crafting.Labeling
local mouse = game.Players.LocalPlayer:GetMouse()
local currentsection = "M"
function reorganize(replacer)
-- oopsie this should be on the server
game.ReplicatedStorage.RemoteEvent:FireServer("Reorganize", replacer, currentsection)
end
local coro = coroutine.create(function()
while true do wait()
label.Position = UDim2.new(0,mouse.X, 0, mouse.Y)
end
end)
coroutine.resume(coro)
craftgui.Tools.MouseButton1Click:Connect(function()
if currentsection == "T" then
if options.Visible == false then
options.Visible = true
else
options.Visible = false
end
else
options.Visible = true
reorganize("T")
currentsection = "T"
end
end)
craftgui.Materials.MouseButton1Click:Connect(function()
if currentsection == "M" then
if options.Visible == false then
options.Visible = true
else
options.Visible = false
end
else
options.Visible = true
reorganize("M")
currentsection = "M"
end
end)
craftgui.Food.MouseButton1Click:Connect(function()
if currentsection == "F" then
if options.Visible == false then
options.Visible = true
else
options.Visible = false
end
else
options.Visible = true
reorganize("F")
currentsection = "F"
end
end)
craftgui.Vehicles.MouseButton1Click:Connect(function()
if currentsection == "V" then
if options.Visible == false then
options.Visible = true
else
options.Visible = false
end
else
options.Visible = true
reorganize("V")
currentsection = "V"
end
end)
craftgui.Structures.MouseButton1Click:Connect(function()
if currentsection == "S" then
if options.Visible == false then
options.Visible = true
else
options.Visible = false
end
else
options.Visible = true
reorganize("S")
currentsection = "S"
end
end)
options.ChildAdded:Connect(function(child)
child.MouseButton1Click:Connect(function()
if child.Parent == options then
game.Players.LocalPlayer.PlayerGui.MainGui.craftingconfirm.Visible = true
game.Players.LocalPlayer.PlayerGui.MainGui.craftingconfirm.Resource.Text = child.Text
game.Players.LocalPlayer.PlayerGui.MainGui.craftingconfirm.Resource:SetAttribute("Name", child.Name)
game.Players.LocalPlayer.PlayerGui.MainGui.craftingconfirm.Recipe.Text = child:GetAttribute("Recipe")
end
end)
child.MouseButton2Click:Connect(function()
if child.Parent == options then
game.ReplicatedStorage.RemoteEvent:FireServer("Craft", child.Name)
end
end)
local MouseOverModule = require(script.MouseOverModule)
local MouseEnter, MouseLeave = MouseOverModule.MouseEnterLeaveEvent(child)
MouseEnter:Connect(function()
if child.Visible == true and child.Parent == options and options.Visible == true then
label.Visible = true
label.Text = child:GetAttribute("Recipe")
MouseLeave:Wait()
label.Visible = false
end
end)
end)
game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm"):WaitForChild("yes").MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm").Visible == true then
game.ReplicatedStorage.RemoteEvent:FireServer("Craft", game.Players.LocalPlayer.PlayerGui.MainGui.craftingconfirm.Resource:GetAttribute("Name"))
game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm").Visible = false
end
end)
game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm"):WaitForChild("no").MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm").Visible == true then
game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("craftingconfirm").Visible = false
end
end)
for _,child in pairs(game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("Crafting").Coptions.Materials:GetChildren()) do
child.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("Crafting").Options
child.Visible = true
end
