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

I have created a jumpscare GUI, but is there a way to activate it when touching a block?

Asked by 9 years ago

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!

1 answer

Log in to vote
0
Answered by 9 years ago

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)
0
You mean to the player's PlayerGui? Tkdriverx 514 — 9y
0
Yeah, I'll edit that. aquathorn321 858 — 9y
0
Thankyou so much! Buzzpops 0 — 9y
Ad

Answer this question