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

Would I need to make a hitbox to make something for if I step on the part a screenGUI shows?

When I tried, it didn't work. Also, would I need to make a hitbox type of thing? I'm really stumped.

4 comments

0

Also, if this seems like a request, it isn't. I've looked around so many places and tried so many times.

0

Then show your attemps so we can help you fix them

0

mind adding some code?

0

mind adding some code?

2 answers

I'm not gonna give you any code, but let me give you instructions so you can learn.

  1. No, you don't really need a hitbox, just a part.
  2. Set up a basic debounce system, as well as a OnTouched system
  3. If debounce is ready, then check the object that hit the "hitbox" for a humanoid
  4. This is the only code I will give you pretend "plyr" is the character that touched the object variable.
local players = game.Players
local find = players:FindFirstChild(plyr.Name)
local plygui = find. --I forgot what it was called
--from here on, you can copy/make a gui visible.

I tried this

script.Parent.Touched:Connect(function(hit)
	
	local  debounce = false
	
	if not debounce then 
	
	debounce = true	
		
		print("Brick was touched!")
		
		wait(5)
		
		debounce = false
	
		
		
	end	
		
end)
Part = script.Parent

function onTouch()
	Part.BrickColor = BrickColor.Random()
end

script.Parent.Touched:Connect(onTouch

This discussion is preserved as it was. New answers, comments, and votes are closed.