Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Intro GUI Not recognizing Lighting Effects in Workspace.Camera. Fixable?

Hello, I am developing a Roleplay Game called Q-BICLE, As of then, I am having issues with designing a script that I have been tinkering with, It seemingly works in Studio, But tends to not work in Real-time on the games servers.

script.Parent.Parent.Frame.Visible = true
game.Workspace.Camera.Blur.Enabled = true
game.Workspace.Camera.ColorCorrection.Enabled = true

script.Parent.music:Play()

This script is intended to set all the values on the Lighting Post Effects to true in the Camera that is designated in Workspace.

local button = script.Parent

button.MouseButton1Click:connect(function()
	script.Parent.Parent.click:play()
	script.Parent.Parent.Parent.Frame.Visible = false
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.9
	game.Workspace.Camera.Blur.Size = 20
	game.Workspace.Camera.ColorCorrection.Saturation = -0.9
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.8
	game.Workspace.Camera.Blur.Size = 16
	game.Workspace.Camera.ColorCorrection.Saturation = -0.8
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.7
	game.Workspace.Camera.Blur.Size = 14
	game.Workspace.Camera.ColorCorrection.Saturation = -0.7
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.6
	game.Workspace.Camera.Blur.Size = 12
	game.Workspace.Camera.ColorCorrection.Saturation = -0.6
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.5
	game.Workspace.Camera.Blur.Size = 10
	game.Workspace.Camera.ColorCorrection.Saturation = -0.5
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.4
	game.Workspace.Camera.Blur.Size = 8
	game.Workspace.Camera.ColorCorrection.Saturation = -0.4
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.3
	game.Workspace.Camera.Blur.Size = 6
	game.Workspace.Camera.ColorCorrection.Saturation = -0.3
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.2
	game.Workspace.Camera.Blur.Size = 4
	game.Workspace.Camera.ColorCorrection.Saturation = -0.2
	wait(0.1)
	script.Parent.Parent.music.Volume = 0.1
	game.Workspace.Camera.Blur.Size = 2
	game.Workspace.Camera.ColorCorrection.Saturation = -0.1
	wait(0.1)
	script.Parent.Parent.music.Volume = 0
	game.Workspace.Camera.Blur.Size = 0
	script.Parent.Parent.Parent.Parent.stuffs.lighttoggle.Visible = true
	script.Parent.Parent.Parent.Parent.stuffs.runbutton.Visible = true
	script.Parent.Parent.Parent.Parent.stuffs.sitbutton.Visible = true
	wait(2)
	script.Parent.Parent.Parent.Parent.music.Sound:Play()
	script.Parent.Parent.Parent.Parent.music.mute.Visible = true
end)

This is a Script that is intended to Play as soon as I press play onto the Players GUI Intro.

The 2 things I need help fixing on is that It for some reason gives me errors every time I play it in a Real time Server, It does not register the Blur Post Effect in the Camera, Nor does it Even recognize the ColorCorrection. I've tried some ways, But I'm scared that I might've just goofed up big time, And That I'm probably too dumb to realize the error.

Also to mention I need any tips on How I can make this Fadeout Script better, It's longer than it should be, and I think Some of you may know how to make it a bit more smaller Via a smoother fade at least?

I appreciate all of your help if you can. And hope I can get this resolved ASAP.

1 answer

I cannot solve the first problem because lack of output. But, I'll solve the next one.

You should use the for keyword. It is very helpful, in that it will do task multiple times nearly instantly. An example of the for keyword is provided below.


for i = 1, 10 do --this will iterate 1 thru 10. 'i' is a variable for storing this iteration
	print(i) --this will print 1 thru 10
end

Anyway, the offical Roblox Wiki explains this better than me. http://wiki.roblox.com/?title=Loops#For

You can use the for keyword to make a smooth, fading effect. If I have a Frame, and I wanted you make it smoothly fade away, I could use the for keyword. You would simply increase the transparency, and wait a 1/60th of a second.

local frame = ...
local button = ...

local function OnClick(playerWhoClicked)
	for i = 1, 100 do
		frame.BackgroundTransparency = frame.BackgroundTransparency + 0.1
		wait(0.06) --so it doesn't go away immediately
	end
end

button.MouseButton1Down:connect(OnClick)

Hope this helped you, Iplaydev.

1 comment

0

That did not assist. I'm trying to do this for a GUI, not a Click-Detector/Workspace Build.

This discussion is preserved as it was. New answers, comments, and votes are closed.