local player = game.Players.LocalPlayer
local name = script.Parent.TextButton.Text
script.Parent.TextButton.MouseButton1Down:connect(function()
game.Players.LocalPlayer.Backpack:FindFirstChild(name)
print(name)
end)
there's no error, it prints something, but it's just a blank line. and there is a weapon name there.
i take it im doing something wrong.
what im trying to do is find the name of the weapon in the text button and equip that weapon
now output is printing
17:20:30.651 - Players.Fearme987.PlayerGui.Main.Holder.1.Script:6: attempt to call method 'Clone' (a nil value)
from this
local player = game.Players.LocalPlayer
local name = script.Parent.TextButton
script.Parent.TextButton.MouseButton1Down:connect(function()
local tool = player.Backpack:FindFirstChild(name.Text)
name.Text:Clone().Parent= player.Backpack
print(name.Text)
end)

1 comment
dude you're awesome :)