not a valid member roblox

local Touch = workspace:WaitForChild("ItemShopTouch"):WaitForChild("Touch")

-- since this is a local script, we can get player easily
-- with this
local player = game.Players.LocalPlayer

-- GUI's in StarterGui will cloned into player > PlayerGui
-- which is the exact place of UI
local JOJO Shop = player.PlayerGui:WaitForChild("JOJO Shop")

-- used to make the script dont run constantly
local debounce = false

-- in game, the script will be inside item
local item = script.Parent

-- whenever the `Touch` Part were Touched, this code runs
Touch.Touched:Connect(function(hit)

	-- check if hit (part) parent is a item
	if hit.Parent == item then

		-- check if debounce variable is false
		if not debounce then
			-- setting debounce to true will make the code
			-- wont run again until it sets into false again
			debounce = true

			-- now the actual code

			-- enable (toggle visibility) of the gui
			-- to true (makes the gui shown in player screen
			JOJO Shop.Enabled = true

			----------------------

			-- wait 2 seconds then set debounce to false
			-- or basically enables the code again after
			-- 2 seconds
			wait(2)
			debounce = false

		end

	end

end)

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source