Having problems with an cutscene module script

Hello, i’m trying to make cutscene module script because to make cutscenes easier.
But i’m getting this error:


Here’s the cutscene UI: CutsceneUI - Roblox
Here’s the module script:

local player = game:GetService("Players").LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local CutsceneGUI = PlayerGui.CutsceneGui
local DialogUI = CutsceneGUI.DialogUI
local CutsceneText = DialogUI.CutsceneText
local CharacterName = DialogUI.CharacterName
local camera = workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local character = player.Character or player.CharacterAdded:Wait()
local CutsceneUI = {}

function CutsceneUI.Dialog(charName, CharacterColor, cuttext, TextSpeed)
	CutsceneGUI.Enabled = true
	CharacterName.Text = charName
	CharacterName.TextColor3 = Color3.fromRGB(CharacterColor)
	CutsceneText.TextColor3 = Color3.fromRGB(CharacterColor)
	local text = cuttext
	for i = 1, #cuttext do
		CutsceneText.Text = string.sub(cuttext,1,i)
		wait(TextSpeed)
	end
	wait(1)
	CutsceneGUI.Enabled = false
end


function CutsceneUI.Camera(camface)
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CameraSubject = camface
	camera.CFrame = camface.CFrame
end


function CutsceneUI.MoveCamera(camfacer, movementspeed)
	local cammove = TweenService:Create(camera, TweenInfo.new(movementspeed), {CFrame = camfacer.CFrame})
	cammove:Play()
end

function CutsceneUI.setupChar(position)
	character.Archivable = true
	wait(1)
	local Avatar = character:Clone()
	Avatar.Name = player.DisplayName
	Avatar.HumanoidRootPart.CFrame = position.CFrame
	Avatar.Parent = workspace
	wait(1)
	character.Archivable = false
	return Avatar
end

return CutsceneUI

And Here’s the localscript in StarterPlayerScripts

local player = game:GetService("Players").LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local CutsceneGui = PlayerGui:WaitForChild("CutsceneGui")
local DialogUI = CutsceneGui.DialogUI
local CutsceneText = DialogUI.CutsceneText
local CharacterName = DialogUI.CharacterName
local CutsceneComponents = require(game.ReplicatedStorage.Modules.CutsceneComponents)
CutsceneComponents.Camera(workspace.gf)
wait(1)
CutsceneComponents.Dialog("Example", 200,200,200, "Doesn't Work", 0.05)

200, 200, 200 is an color value.

The parameter from here and here

Aren’t the same instead if using 200,200… for color just simply pass the parameter with color3.fromRGB(200,200,200)
Like this:

CutsceneComponents.Dialog("Example", Color3.fromRGB(200,200,200),"Doesn't Work", 0.05)

And I assume you will obviously need to change a bit of the script in the module here:

CharacterName.TextColor3 = CharacterColor
	CutsceneText.TextColor3 = CharacterColor

Because the 3rd parameter you gave is 200, because it splits parameter with comma, so do:

Color3.fromRGB(200, 200, 200)

instead of

200, 200, 200
1 Like