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!
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