-
What do you want to achieve? Keep it simple and clear!
Giving a player a tool that everyone can see when they hold it. -
What is the issue? Include screenshots / videos if possible!
In testing, when I go to server side, the tool is not there.
This script gives the player the tool.
Ignore all the other food items, just the raw chicken for now, the lines of script that give the tool are at the very bottom.
--|OTHER|--
local UI = script.Parent.MainFrame
local DB = false
local sound1 = script.Parent["Open/Close"]
local sound2 = script.Parent.Click
local sound3 = script.Parent.Hover
--|FOOD|--
local FoodFrame = UI.FoodFrame
local FoodList = FoodFrame.Food
--FOOD ITEMS--
local RawChicken = FoodList.RawChicken
local RawSteak = FoodList.RawSteak
local Ham = FoodList.Ham
local IceCream = FoodList.IceCream
local Eggs = FoodList.Eggs
local Beef = FoodList.Beef
local Carrots = FoodList.Carrots
local Cheese = FoodList.Cheese
local Tomato = FoodList.Tomato
local Celery = FoodList.Celery
local Lettuce = FoodList.Lettuce
local Fish = FoodList.Fish
--|FOOD BUTTONS|--
local RCB = RawChicken.TextButton
local RSB = RawSteak.TextButton
local HB = Ham.TextButton
local ICB = IceCream.TextButton
local EB = Eggs.TextButton
local BB = Beef.TextButton
local CB = Carrots.TextButton
local CHB = Cheese.TextButton
local TB = Tomato.TextButton
local CEB = Celery.TextButton
local LB = Lettuce.TextButton
local FB = Fish.TextButton
--|BUTTON ANIMATIONS|--
local DarkColor = Color3.fromRGB(73, 73, 74)
local LightColor = Color3.fromRGB(162, 162, 162)
RawChicken.MouseEnter:Connect(function()
sound3:Play()
RawChicken.BackgroundColor3 = DarkColor
end)
RawChicken.MouseLeave:Connect(function()
sound3:Play()
RawChicken.BackgroundColor3 = LightColor
end)
RawSteak.MouseEnter:Connect(function()
sound3:Play()
RawSteak.BackgroundColor3 = DarkColor
end)
RawSteak.MouseLeave:Connect(function()
sound3:Play()
RawSteak.BackgroundColor3 = LightColor
end)
Ham.MouseEnter:Connect(function()
sound3:Play()
Ham.BackgroundColor3 = DarkColor
end)
Ham.MouseLeave:Connect(function()
sound3:Play()
Ham.BackgroundColor3 = LightColor
end)
IceCream.MouseEnter:Connect(function()
sound3:Play()
IceCream.BackgroundColor3 = DarkColor
end)
IceCream.MouseLeave:Connect(function()
sound3:Play()
IceCream.BackgroundColor3 = LightColor
end)
Eggs.MouseEnter:Connect(function()
sound3:Play()
Eggs.BackgroundColor3 = DarkColor
end)
Eggs.MouseLeave:Connect(function()
sound3:Play()
Eggs.BackgroundColor3 = LightColor
end)
Beef.MouseEnter:Connect(function()
sound3:Play()
Beef.BackgroundColor3 = DarkColor
end)
Beef.MouseLeave:Connect(function()
sound3:Play()
Beef.BackgroundColor3 = LightColor
end)
Carrots.MouseEnter:Connect(function()
sound3:Play()
Carrots.BackgroundColor3 = DarkColor
end)
Carrots.MouseLeave:Connect(function()
sound3:Play()
Carrots.BackgroundColor3 = LightColor
end)
Cheese.MouseEnter:Connect(function()
sound3:Play()
Cheese.BackgroundColor3 = DarkColor
end)
Cheese.MouseLeave:Connect(function()
sound3:Play()
Cheese.BackgroundColor3 = LightColor
end)
Tomato.MouseEnter:Connect(function()
sound3:Play()
Tomato.BackgroundColor3 = DarkColor
end)
Tomato.MouseLeave:Connect(function()
sound3:Play()
Tomato.BackgroundColor3 = LightColor
end)
Celery.MouseEnter:Connect(function()
sound3:Play()
Celery.BackgroundColor3 = DarkColor
end)
Celery.MouseLeave:Connect(function()
sound3:Play()
Celery.BackgroundColor3 = LightColor
end)
Lettuce.MouseEnter:Connect(function()
sound3:Play()
Lettuce.BackgroundColor3 = DarkColor
end)
Lettuce.MouseLeave:Connect(function()
sound3:Play()
Lettuce.BackgroundColor3 = LightColor
end)
Fish.MouseEnter:Connect(function()
sound3:Play()
Fish.BackgroundColor3 = DarkColor
end)
Fish.MouseLeave:Connect(function()
sound3:Play()
Fish.BackgroundColor3 = LightColor
end)
--|BUTTON OUTPUTS|--
local player = game.Players.LocalPlayer
RCB.MouseButton1Click:Connect(function()
if not DB then
DB = true
sound2:Play()
local ChickenModel = game.ReplicatedStorage.RawChicken:Clone()
ChickenModel.Parent = player.Backpack
local ChickenHandle = game.ReplicatedStorage.RawChicken.Handle
local Weld = Instance.new("Weld")
Weld.Part0 = player.Character.RightHand
Weld.Part1 = ChickenHandle
Weld.C0 = CFrame.new(0, 0, 0)
Weld.Parent = ChickenHandle
wait(10)
DB = false
end
end)