So here I have two tool scripts that give a item when clicked. One gives Drink1, another one gives, Raw Hamburger. How would I combine the two scripts to give one item and have the two parts still present?
Script 1
script.Parent.ClickDetector.MouseClick:connect(function(player)
local cup = script.Parent.Parent:FindFirstChild("Cup")
cup.CFrame = CFrame.new (cup.CFrame.X,cup.CFrame.Y-0.0,cup.CFrame.Z)
local tool = script.Tool:clone()
local handle = script.Parent.Parent.Cup:clone()
tool.Parent = player.Backpack
handle.Parent = tool
handle.Name = "Handle"
tool.ToolTip = script.Parent.Parent.Name
tool.Name = "Raw Hamburger"
for _,two in pairs(tool:GetChildren()) do
if two:IsA ("LocalScript") then
two.Disabled = false
wait()
end
end
for i = 1,8 do
cup.CFrame = CFrame.new(cup.CFrame.X,cup.CFrame.Y+0.0,cup.CFrame.Z)
wait()
end
end)
Script 2
script.Parent.ClickDetector.MouseClick:connect(function(player)
local Drink1 = script.Parent.Parent:FindFirstChild("Drink1")
Drink1.CFrame = CFrame.new (Drink1.CFrame.X,Drink1.CFrame.Y-0.0,Drink1.CFrame.Z)
local tool = script.Tool:clone()
local handle = script.Parent.Parent.Drink1:clone()
tool.Parent = player.Backpack
handle.Parent = tool
handle.Name = "Handle"
tool.ToolTip = script.Parent.Parent.Name
tool.Name = "Drink1"
for _,two in pairs(tool:GetChildren()) do
if two:IsA ("LocalScript") then
two.Disabled = false
wait()
end
end
for i = 1,8 do
Drink1.CFrame = CFrame.new(Drink1.CFrame.X,Drink1.CFrame.Y+0.0,Drink1.CFrame.Z)
wait()
end
end)
