Help with simple script

Trying to make a textbox change a lighting. This time, it’s blur.

local blur = game.Lighting.Blur
local bl = script.Parent.Text

while true do
blur.Size = bl
wait(0.03)
end

edit: it changes the first time but if a player edits the text, it doesn’t change

Can you elaborate a bit more on what you’re trying to do? So far I’m seeing you try to change the blur size to a string which doesn’t really make sense…

1 Like

Hope it’s easier.

So a player types in the textbox next to textlabel named “BLUR:” and the text in the textbox is what the size of the blur in lighting is.

what is the blur lightning :thinking:

1 Like
local blur = game.Lighting.Blur
local blurAmount = script.Parent.Text

while true do
blur.Size = tonumber(bl)
wait(0.03)
end

its a string pretty sure it has to be a number i already stated that @itsXtimes way before u

1 Like

idk what you mean but I think this can work:

local blur = game.Lighting.Blur
local bl = script.Parent

while true do
	if tonumber(bl.Text) ~= nil then
		blur.Size = tonumber(bl.Text)
	end
	wait(0.03)
end
1 Like

no I did changes

if you just put tonumber without checking it’s nil then it can bring errors

I tried values. Maybe this isn’t a simple script. Your scripts look like they work but they don’t apparently

whos script is not working???

my script and its a blur changing gui. (player type number, number is the size of blur)

They just wrote a possible solution to your code… try them.

1 Like
local blur = instance.new("Blur", workspace.Currentcamera)
local bl = script.Parent

while true do
	if tonumber(bl.Text) ~= nil then
		blur.Size = tonumber(bl.Text)
	end
	wait(0.03)
end

is this in a server script or local script?

1 Like

oh no… I forgot about local scripts. time to try it out xD

1 Like

Yeah use localscripts for GUI’s.

2 Likes

Okay time to mark somebody as solution and that means the first script i find that works

1 Like