I found this ModuleScript that makes Bezier Curves with tweening. When I pasted the code to function this, The module script was not being defined. I tried using WaitForChild() but it gave me this warning instead:
Local Script:
--TweenService
local TweenService = game:GetService("TweenService")
local ServerScriptService = game:GetService("ServerScriptService")
--Cameras
local Camera = workspace.CurrentCamera
local ShopCam = workspace.ShopCam
local CamPart = workspace.CamPart
--Frames
local ShopFrame = script.Parent.Parent.ShopFrame
--Buttons
local SettingsButton = script.Parent.Parent.OpenSettings
local OpenCredits = script.Parent.Parent.OpenCredits
local PlayButton = script.Parent.Parent.Play
local OpenShop = script.Parent
local isButtonActive = true
local BezierTween = require(ServerScriptService:WaitForChild("BezierTweens"))
local Waypoints = BezierTween.Waypoints
local P0, P1, P2, P3 = workspace.WaypointsShop.P0, workspace.WaypointsShop.P1, workspace.WaypointsShop.P2, workspace.WaypointsShop.P3
waypoints = Waypoints.new(P0, P1, P2, P3)
local Part = game.Workspace.Part
local Tween = BezierTween.Create(Part, {
Waypoints = waypoints,
EasingStyle = Enum.EasingStyle.Sine,
EasingDirection = Enum.EasingDirection.In,
Time = 5,
})
OpenShop.MouseButton1Click:Connect(function()
if not isButtonActive then
return
end
isButtonActive = false -- Disable the button
PlayButton:TweenPosition(UDim2.new(0.5, 0, 1.072, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, false)
OpenCredits:TweenPosition(UDim2.new(0.413, 0, 1.04, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, false)
SettingsButton:TweenPosition(UDim2.new(0.5, 0, 1.04, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, false)
OpenShop:TweenPosition(UDim2.new(0.586, 0, 1.04, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, false)
Camera.CameraType = Enum.CameraType.Scriptable
local tween = TweenService:Create(Camera, TweenInfo.new(2.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0), {CFrame = ShopCam.CFrame})
tween:Play()
Tween:Play()
wait(5)
ShopFrame.Visible = true
isButtonActive = true
end)
Where the warning happens: