so im trying to make a 3d title screen where random scenes load in, this one has a looping tween of something moving down repeatedly but as soon as I start it up, the cloning works correctly even capable of activating and deactivating each of the scripts but the scripts themselves wont work even though I'm not getting a single error, both script types are local
this is the script that clones the scene itself:
local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer local camera = workspace.CurrentCamera local cam function Cammove() camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = workspace.current.Backplate camera.CFrame = workspace.current:FindFirstChild(cam.Value).CFrame end function LightingChange() local Lighting = workspace.current.Configuration.Lighting game.Lighting.GlobalShadows = Lighting.GlobalShadows.Value game.Lighting.FogEnd = Lighting.FogEnd.Value game.Lighting.FogColor = Lighting.FogColor.Value game.Lighting.FogStart = Lighting.FogStart.Value end function scr1 () local screen1 = game.ReplicatedStorage:WaitForChild("Screen1") local new = screen1:Clone() new.Parent = workspace new.Name = 'current' new.Backplate.LocalScript.Disabled = false new.Blocks.Move.Disabled = false cam = workspace.current.Configuration.Camera Cammove() LightingChange() end scr1()
and this is the script that starts the tween:
--d2 -206, -102, -249 local TweenService = game:GetService("TweenService") local part = script.Parent local info = TweenInfo.new( 10, --length(seconds) Enum.EasingStyle.Linear, --easing style Enum.EasingDirection.InOut, --easing direction 999999999999, --times repeated false, --reverse? 0 --delay(in seconds) ) local Goal = { Position = Vector3.new(-206, -102, -249) } local tween = TweenService:Create(part,info,Goal) tween:Play()
Instead of having another LocalScript, I've combined the code from the second script into this one.
local TweenService = game:GetService("TweenService") local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer repeat wait() until workspace.CurrentCamera local camera = workspace.CurrentCamera local cam function Cammove() camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = workspace.current.Backplate camera.CFrame = workspace.current:FindFirstChild(cam.Value).CFrame end function LightingChange() local Lighting = workspace.current.Configuration.Lighting game.Lighting.GlobalShadows = Lighting.GlobalShadows.Value game.Lighting.FogEnd = Lighting.FogEnd.Value game.Lighting.FogColor = Lighting.FogColor.Value game.Lighting.FogStart = Lighting.FogStart.Value end function scr1 () local screen1 = game.ReplicatedStorage:WaitForChild("Screen1") local new = screen1:Clone() new.Name = 'current' new.Blocks.Move.Disabled = false new.Parent = workspace local part = new.Backplate local info = TweenInfo.new( 10, --length(seconds) Enum.EasingStyle.Linear, --easing style Enum.EasingDirection.InOut, --easing direction 999999999999, --times repeated false, --reverse? 0 --delay(in seconds) ) local Goal = { Position = Vector3.new(-206, -102, -249) } local tween = TweenService:Create(part,info,Goal) tween:Play() cam = workspace.current.Configuration.Camera Cammove() LightingChange() end scr1()