game.Players.LocalPlayer.Backpack:WaitForChild("Hamburger", 300) game.Workspace.Npc.NPC.TriggerBlock.Text.Value =("Wow thanks") game.Workspace.Npc.NPC.TriggerBlock.Text.Text.Value = ("Here have 100 candies! :D") game.Workspace.Npc.NPC.TriggerBlock.Text.Text.Text.Value =("Bye! :)") game.Players.LocalPlayer.leaderstats.Candy = game.Players.LocalPlayer.leaderstats.Candy+100
Hello, Voideyz!
To find a thing on a part, you must use a if
and :FindFirstChild()
!
Working script:
if game.Players.LocalPlayer.Backpack:FindFirstChild("Hamburger", 300) or game.Workspace[ game.Players.LocalPlayer.Name]:FindFirstChild("Hamburger", 300) then -- the "game.Workspace[ game.Players.LocalPlayer.Name]:FindFirstChild("Hamburger", 300)" is to detect even if player is holding the item! game.Workspace.Npc.NPC.TriggerBlock.Text.Value =("Wow thanks") game.Workspace.Npc.NPC.TriggerBlock.Text.Text.Value = ("Here have 100 candies! :D") game.Workspace.Npc.NPC.TriggerBlock.Text.Text.Text.Value =("Bye! :)") game.Players.LocalPlayer.leaderstats.Candy = game.Players.LocalPlayer.leaderstats.Candy + 100 end
Good Luck with your games!