Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

0
Also, if this seems like a request, it isn't. I've looked around so many places and tried so many times. SPL00_YT -5 — 3y
0
Then show your attemps so we can help you fix them imKirda 4491 — 3y
0
mind adding some code? TickoGrey 116 — 3y
0
mind adding some code? TickoGrey 116 — 3y

2 answers

Log in to vote
0
Answered by
A_Mp5 222 Moderation Voter
3 years ago

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.
Ad
Log in to vote
0
Answered by 3 years ago

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

Answer this question