#can anyone help me point out what the fuck is wrong with this script

1 messages · Page 1 of 1 (latest)

upbeat rover
#

im making a jumpscare but the frame and the imagelabel wont work after i triggered the jumpscare again

#

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local event = game.ReplicatedStorage:WaitForChild("JumpscareEvent")

local jumpscareGui = playerGui:WaitForChild("Jumpscare")
local frame = jumpscareGui:WaitForChild("Frame")
local face = frame:WaitForChild("Face")

jumpscareGui.Enabled = true
frame.Visible = false
face.Visible = false
face.Size = UDim2.new(0, 250, 0, 250)
face.AnchorPoint = Vector2.new(0.5,0.5)
face.Position = UDim2.new(0.5,0,0.5,0)

#

local lighting = game:GetService("Lighting")
local cooldownTime = 6
local isCooldown = false

local function doJumpscare()
if isCooldown then return end
isCooldown = true

frame.Visible = true
face.Visible = true
face.ImageColor3 = Color3.new(1,1,1)
face.Size = UDim2.new(0, 250, 0, 250)
face.Rotation = 0

local color = Instance.new("ColorCorrectionEffect")
color.TintColor = Color3.fromRGB(255,0,0)
color.Contrast = -2
color.Saturation = 0
color.Parent = lighting

local blur = Instance.new("BlurEffect")
blur.Size = 0
blur.Parent = lighting
for i = 0, 1, 0.1 do
    blur.Size = i*5
    task.wait(0.01)
end

local origin = face.Position
for _ = 1, 50 do
    face.Position = origin + UDim2.new(0, math.random(-10,10), 0, math.random(-10,10))
    face.Rotation = math.random(-10,10)
    task.wait(0.03)
end
#

local startSize = face.Size
local endSize = UDim2.new(0, 350, 0, 350)
local growDur = 0.8
local growStart = tick()
while tick() - growStart < growDur do
local t = (tick() - growStart)/growDur
t = ttt
face.Size = startSize:Lerp(endSize, t)
face.ImageColor3 = face.ImageColor3:Lerp(Color3.new(0,0,0), t)
task.wait()
end

task.wait(0.2)

face.Visible = false
frame.Visible = false
color:Destroy()
blur:Destroy()

task.delay(cooldownTime, function()
    isCooldown = false
end)

end

event.OnClientEvent:Connect(doJumpscare)

#

this is the script

#

help me guys

#

i cant just figure it out

#

volume warning)

balmy flare
#

Did u parent the gui?

delicate laurel
#

Did u disable "ResetOnSpawn"

upbeat rover
upbeat rover
delicate laurel
#

You're declaring the gui at the top of the script, which mean it will never be updated. Even when destroyed. If u have ResetOnSpawn on it will destroy and rebuild the Gui if the player respawns

#

Disable it and try

upbeat rover
#

i should set false to reset on spawn?

delicate laurel
#

Yes

upbeat rover
#

fucking chatgpt

delicate laurel
#

What

#

?

upbeat rover
#

i asked chatgpt first and they say do not turn off the reset on sapwn

#

before*

delicate laurel
#

He didn't know that u would die from that

upbeat rover
#

damn

#

tysm for help bro

delicate laurel
#

But ye just use ai as a last resort

#

Bp

#

Np

upbeat rover
#

@delicate laurel

#

ey bro

#

i need help again

#

does putting colorcorrection in the playergui makes the player see the effect but anyone doesnt

jovial nymph
#

Color correction is a lighting only child i believe

upbeat rover
#

what

jovial nymph
#

To make only the player you want see it, you must assign color correction via the client

#

ColorCorrection. The instance correct?

upbeat rover
#

im new bro

#

can you uh explain it in the most basic way

jovial nymph
#

Are we talking about the thing that changes the color of the players visuals

#

Make the color correction blue the player sees a blue tint. Right?

upbeat rover
#

ye

jovial nymph
#

Ok, yes. ColorCorrection can only work in the lighting

#

So in order to make one player see it but no one else, it must be ran through a LocalScript

upbeat rover
#

how

#

im working on a local script inside SPS

jovial nymph
#

Ok cool

upbeat rover
#

but it dont work

jovial nymph
#

So create a new colorcorrection instance or clone an already existing one

#

Then parent it to lighting

upbeat rover
#

wait i thought that make other player can see

jovial nymph
#

Nope, because a local script runs it

upbeat rover
#

i always ask chatgpt

jovial nymph
#

This is your basic client server relationship

#

Server replicates to all clients, clients do not replicate to server, or any other clients

upbeat rover
#

and he always say the oppistie of you guys

jovial nymph
#

That is your basic filtering enabled basics that you use to be able to toggle

upbeat rover
#

okay thank you

upbeat rover
jovial nymph
upbeat rover
upbeat rover
jovial nymph
#

Sure it can get things right every now and again, but it has no context of your entire situation. We do.

delicate laurel
delicate laurel