Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can anyone explain why it wont print working if the item is there?

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

2 comments

0

Are you sure you're using a local script?

0

Yes, I'm sure and plus your answer didn't work at all.

1 answer

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

1 comment

0

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.