How to make 2x flaslight?

So I have this script in my game

local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Humanoid = Character:WaitForChild("Humanoid")
		local GamepassID = 194497870 
		local Multiplier = 2

		if MarketplaceService:UserOwnsGamePassAsync(Player.UserID, GamepassID) then
			Brightness * Multiplier
		end
	end)
end)
local cam = workspace.CurrentCamera
local RS = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Flashlight = RS.flashlight
local Clone = Flashlight:Clone()
Clone.Parent = script.Parent

local Brightness = 3

local Keybind = Enum.KeyCode.F

local UIS = game:GetService("UserInputService")

local Toggle = false

local Mouse = game.Players.LocalPlayer:GetMouse()

local TS = game:GetService("TweenService")
local TI = TweenInfo.new(.1, Enum.EasingStyle.Sine)


UIS.InputBegan:Connect(function(Input, p)
	if p then return end
	if Input.KeyCode == Keybind then
		Toggle = not Toggle
	end
end)

RunService.RenderStepped:Connect(function()
	if Clone then

		Clone.Position = cam.CFrame.Position
		TS:Create(Clone, TI, {CFrame = CFrame.lookAt(Clone.Position, Mouse.Hit.Position)}):Play()

		if Toggle then
			TS:Create(Clone.SpotLight, TI, {Brightness = Brightness}):Play()

		else
			TS:Create(Clone.SpotLight, TI, {Brightness = 0}):Play()
		end

	end
end)

I want to make a 2x flashlight gamepass, how do I make that? My best guess is

local cam = workspace.CurrentCamera
local RS = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Flashlight = RS.flashlight
local Clone = Flashlight:Clone()
Clone.Parent = script.Parent

local Brightness = 3

local Keybind = Enum.KeyCode.F

local UIS = game:GetService("UserInputService")

local Toggle = false

local Mouse = game.Players.LocalPlayer:GetMouse()

local TS = game:GetService("TweenService")
local TI = TweenInfo.new(.1, Enum.EasingStyle.Sine)


UIS.InputBegan:Connect(function(Input, p)
	if p then return end
	if Input.KeyCode == Keybind then
		Toggle = not Toggle
	end
end)

RunService.RenderStepped:Connect(function()
	if Clone then

		Clone.Position = cam.CFrame.Position
		TS:Create(Clone, TI, {CFrame = CFrame.lookAt(Clone.Position, Mouse.Hit.Position)}):Play()

		if Toggle then
			TS:Create(Clone.SpotLight, TI, {Brightness = Brightness}):Play()

		else
			TS:Create(Clone.SpotLight, TI, {Brightness = 0}):Play()
		end

	end
end)

But that doest seem to work, Im new to scripting so please explain as clear as possible

1 Like

do you get any errors in the error panel?

No, should that code work? I dont see any differences

The codes I pasted are inversed, sorry. The 1st one should be the 2nd one

Try changing that to Brightness = Brightness * Multiplier

this would work

Brightness *= Multiplier

1 Like

I somehow fixed it, but Im unsire if it does anything, how do I test a game with gamepass? I mean, I dont own it so…

if u make a prompt to buy it in studio u can get it for free but it doesnt actually give it to u only gives it for testing purposes inside of studio