local textb = game.StarterGui.ScreenGui.TextButton
textb.MouseButton1Click:connect(function(e) if game.Players.LocalPlayer.Backpack.Item then
print("Working.")
end
end)
StarterGUI
ScreenGUI
TextButton
Script
That how it goes
local textb = game.StarterGui.ScreenGui.TextButton
textb.MouseButton1Click:connect(function(e) if game.Players.LocalPlayer.Backpack.Item then
print("Working.")
end
end)
StarterGUI
ScreenGUI
TextButton
Script
That how it goes
Change
local textb = game.StarterGui.ScreenGui.TextButton
to
local textb = script.Parent
also, to make sure that your script doesn't return error, change
if game.Players.LocalPlayer.Backpack.Item then
to
if game.Players.LocalPlayer.Backpack:FindFirstChild("Item") then
also make sure that you are using LocalScript
I don't have it script.parent because there's another script
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Are you sure you're using a local script?
Yes, I'm sure and plus your answer didn't work at all.