Hello!
I am having trouble creating a jumpscare as the gui is coming from the side rather than the centre of the screen. Here is my code
local val = game.Workspace.Kickdoor.Value1
local gui = script.Parent
local js = gui.Parent.jsglitch
local glitchc = game.Workspace.glitchcreep
local glitch = game.Workspace.Glitch
local jss = game.Workspace.jssound
local waitnum = math.random(0.2,3)
js.Visible = false
gui.Visible = false
js:TweenSize(UDim2.new(0.01,0,0.01,0), "Out", "Sine", 1)
js:TweenPosition(UDim2.new(0,0,0,0), "Out", "Sine", 1)
val:GetPropertyChangedSignal("Value"):Connect(function()
if val.Value == 2 then
gui.Visible = true
wait(0.3)
gui.Visible = false
wait(0.3)
gui.Visible = true
wait(0.3)
gui.Visible = false
wait(0.3)
gui.Visible = true
wait (0.1)
gui.Visible = false
wait(waitnum)
js.Visible = true
wait(2)
glitchc:Play()
jss:Play()
glitch:Play()
js:TweenPosition(UDim2.new(0,0,0,0), "Out", "Sine", 0.1)
js:TweenSize(UDim2.new(1,0,1,0), "Out", "Sine", 0.3)
wait(0.3)
js:TweenPosition(UDim2.new(0,0,0,600), "Out", "Sine", 0.4)
wait(2)
glitchc.Volume = 2.5
wait(0.1)
glitchc.Volume = 2.3
wait(0.1)
glitchc.Volume = 2
wait(0.1)
glitchc.Volume = 1.8
wait(0.1)
glitchc.Volume = 1.4
wait(0.1)
glitchc.Volume = 1
wait(0.1)
glitchc.Volume = 0.9
wait(0.1)
glitchc.Volume = 0.5
wait(0.1)
glitchc.Volume = 0.2
wait(0.1)
glitchc:Stop()
end
end)
and this is the part that the issue is happening in:
js:TweenPosition(UDim2.new(0,0,0,0), "Out", "Sine", 0.1)
js:TweenSize(UDim2.new(1,0,1,0), "Out", "Sine", 0.3)
wait(0.3)
js:TweenPosition(UDim2.new(0,0,0,600), "Out", "Sine", 0.4)
If anybody could resolve the issue, that would be great :]