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

Tween Error, Attempt to call table value?

Error

Players.The_Saver31.PlayerGui.Fade.LocalScript:5: attempt to call a table value

Script

local TweenService = game:GetService("TweenService")
local Duration = 5
local played = false

local Fade = TweenService:Create(script.Parent.Frame, TweenInfo(Duration), {BackgroundTransparency = 0})

local player = game.Players.LocalPlayer

while wait() do
	if player:WaitForChild("Data").Teleporting.Value == true then
		if played == false then
			played = true
			Fade:Play()
		end
	end
end

Can someone help me?

Thank's for reading!

1 answer

✓ Accepted answer
local TweenService = game:GetService("TweenService")
local Duration = 5
local played = false

local Fade = TweenService:Create(script.Parent.Frame, TweenInfo.new(Duration), {BackgroundTransparency = 0}) -- you forgot to add a ".new" right after declaring TweenInfo

local player = game:GetService("Players").LocalPlayer

while wait() do -- not sure why you are spamming a tween every frame but ok
    if player:WaitForChild("Data").Teleporting.Value == true and played == false then -- you can combine both if statements into one
        played = true
        Fade:Play()
    end
end

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