Textcolor wont tween

I am programming a credits GUI just for fun, and wanted to add a cool text color rainbow effect at the end for the “title”. I keep on getting this error once the code gets the part where the color changes.

Players.FARLOKIE.PlayerGui.Creds.Frame.LocalScript:41: attempt to call a table value  -  Client - LocalScript:41

This line is the first text color change line, or

TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.333333, 1, 0.498039)}):Play()

I’m sorry for your eyes - this code is so messy

local playerGUI = game.Players.LocalPlayer.PlayerGui

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local TS = game:GetService("TweenService")

local GUI = playerGUI.Creds
local CreditName = GUI.Frame.CreditName
local DevName = GUI.Frame.DevName
local TITLE = GUI.Frame.TITLE

local CNTweenClose = TS:Create(CreditName, TweenInfo.new(1), {TextTransparency = 1})
local CNTweenOpen = TS:Create(CreditName, TweenInfo.new(1), {TextTransparency = 0})

local DNTweenClose = TS:Create(DevName, TweenInfo.new(1), {TextTransparency = 1})
local DNTweenOpen = TS:Create(DevName, TweenInfo.new(1), {TextTransparency = 0})

local function credits()
	CreditName.Text = "PROGRAMMED BY"
	DevName.Text = "FARLOKIE"
	wait(1)
	CNTweenOpen:Play()
	wait(2)
	DNTweenOpen:Play()
	wait(2)
	CNTweenClose:Play()
	DNTweenClose:Play()
	wait(1)
	CreditName.Text = "CREDNAMEHERE"
	DevName.Text = "DEVNAMEHERE"
	wait(2)
	CNTweenOpen:Play()
	wait(2)
	DNTweenOpen:Play()
	wait(3)
	CNTweenClose:Play()
	DNTweenClose:Play()
	wait(5)
	TS:Create(TITLE, TweenInfo.new(2), {TextTransparency = 0}):Play()
	wait(3)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.333333, 1, 0.498039)}):Play()
	wait(0.7)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.666667, 0.666667, 1)}):Play()
	wait(0.7)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.333333, 0, 0)}):Play()
	wait(0.7)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.666667, 1, 1)}):Play()
	wait(0.7)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(1, 0.333333, 0)}):Play()
	wait(0.7)
	TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(9, 9, 9)}):Play()
	wait(0.7)
end

credits()

Any help is appreciated

Where is line 41?

The first color change line:

TS:Create(TITLE, TweenInfo(0.5), {TextColor3 = Color3.fromRGB(0.333333, 1, 0.498039)}):Play()

TweenInfo.new(0.5)

You forgot the .new lol

1 Like

yup

Also because you’re doing Color3.fromRGB instead of Color3.new all the text colors will just stay black. RGB goes from 0-255 but .new goes from 0-1 so swap those out

Oh my lordy lord. thats a bit awkward

Thank you very much - to both of you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.