The jumpscare is freddy from FNAF, and I was just wondering if when the player touched the brick, whether it was possible for the gui to pop up? Thanks for reading!
COMMUNITY QUESTION
I have created a jumpscare GUI, but is there a way to activate it when touching a block?
1 answer
Easy, just clone it to the player's PlayerGui:
local time = 5 --seconds you want the jumpscare to last
local debounce = {}
local brick = workspace.brick --where brick is a reference to the brick you wan't to be the jumpscare giver
local jumpscare = workspace.Jumpscare --where jumpscare is a reference to the gui
brick.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and not debounce[player.Name] then
debounce[player.Name] = true
local clone = jumpscare:Clone()
clone.Parent = player.PlayerGui
wait(time)
clone:Destroy()
debounce[player.Name] = nil
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You mean to the player's PlayerGui?
Yeah, I'll edit that.
Thankyou so much!