local box = script.Parent.Parent:WaitForChild('TextBox')
local button = script.Parent
local code = "freegun"
local tries = 0
local maxtries = 99999999
local player = game.Players.LocalPlayer
button.MouseButton1Down:connect(function()
if box.Text == code then
wait()
box.Text = "Code Accepted"
local tool = script.Parent:WaitForChild("Tool"):Clone()
tool.Parent = player.Backpack
else
wait()
button.Text = "Incorrect Code"
tries = tries + 1
end
end)
The tool is currently the child of a text button. I would like the tool to be in ReplicatedStorage. What changes do I need to add in my script?

2 comments
wiki.roblox.com
Where's this script placed in?