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

What is preventing this script from tinting the screen?

This script is supposed to teleport you to a random level when you click the model. I was it to give a tint to the player's screen only (without using FE).

Here's what I have in the script that puts the local script in the character:

function click(player)
	
	local stats = player:findFirstChild('leaderstats')
	local level = stats:FindFirstChild('Level')
	level.Value = math.random(1,6)
	local brick =	workspace:FindFirstChild(level.Value)
	player.Character:MoveTo(brick.Position)
	local t = script.Tinting:clone()
	t.Parent = player.Character
	t.Disabled = false
	
end
script.Parent.ClickDetector.MouseClick:connect(click)

Here's the local script called "Tinting"

local cam = workspace.CurrentCamera
local t = script.Tint:clone()
t.Parent = cam
wait(10)
t:Remove()
script:Remove()

This works in studio, but not in the normal game.

2 answers

I believe, (and don't make me feel bad) that the script:Remove() in your 'Tinting' script. If this problem isn't solved, it's somewhat part of t he whole script your using.

local cam = workspace.CurrentCamera
local t = script.Tint:clone()
t.Parent = cam
wait(10)
t:Remove()
script:Remove()

The script called tinting, use :Destroy(), not :Remove(). Im not too advanced at scripting and thats the only error I see!

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