I used AI chitGPT to write this all… doesn’t WORK!!! I thought ChitGPT.5 was the best version it has…??
first of all… i want to do a part that moves when i join the game from point a… to point b… SO WHEN I JOIN, it first teleports after 13.5 secs to point a, then waits 5, then teleports to point b… and with smooth animation…and with sounds…
Butwhen i join nothing happenss, THE PART DOESN’T APPEAR… it made me so angered that I ACTUALLY crashed my 5th helicopter into the street, cutting all light sources nearby.
here’s my script.
-- Part moving script handler
-- game.ServerScriptService://Part_MOVING_SCRIPT_HANDLER
-- What this does:
-- It moves a part from destination A to destination B, waiting exactly 13.5 since the player's joined the game — with a smooth animation!
-- Efficient and ready-to-work script!
-- ChitGPT this doesn't work, it doesn't even spawn the PART. Please fix all of the script and give me the whole script to copy and paste, also comment everything so I can understand it better because I want to become a better scripter and better developer for me. Thanks ChitGPT, i hope you have a good day!
-- keep in mind chitgpt that this is a server script not a client script so you know! and this is luau roblox so you know, and we are at the date 12-12-2025!
-- Variables
local part = Instance.new("Part") -- Creates the part, efficiently
local pointA_Part = Instance.old("Part") -- creates an old part, which is connected to is descendant — the new part
local pointB_Part = Instance.old("Part") -- creates an old part, which is connected to is descendant — the new part
local twinService = game:GetService("TwinService") -- Used for smooth animations
local twinsInformation = twininfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In) -- The information for smooth animations (wow this rhymed good j*b chitGPT!)
print("This part works, testing!") -- Debug, emergency and testing print
-- Setting the parts for-use:
print("Working.") -- Debug, emergency and testing print
part.Position = Vector3.new(0,10,0) -- Sets the position of the part.
part.Anchored = true -- Prevents it from falling
part.Parent = workspace -- Parents it to workspace, efficiently making it exist and ready-for-use.
print("Working.") -- Debug, emergency and testing print
pointA_Part.Position = Vector3.new(0,10,10) -- Sets the position of the part.
pointA_Part.Anchored = true -- Prevents it from falling
pointA_Part.Parent = workspace -- Parents it to workspace, efficiently making it exist and ready-for-use.
pointA_Part.Transparency = 1 -- Makes it invisible
print("Working.") -- Debug, emergency and testing print
pointB_Part.Position = Vector3.new(10,10,0) -- Sets the position of the part.
pointB_Part.Anchored = true -- Prevents it from falling
pointB_Part.Parent = workspace -- Parents it to workspace, efficiently making it exist and ready-for-use.
pointB_Part.Transparency = 1 -- Makes it invisible
print("Working.") -- Debug, emergency and testing print
-- Main
print("Working.") -- Debug, emergency and testing print
local serviceWhenPlayerJoins_FirstFinding_OrJustTheLocalPlayerEvents = game:GetService("LocalPlayerEvents") -- Gets first the local player events
local serviceWhenPlayerJoins_FindingSuccess = serviceWhenPlayerJoins_FirstFinding_OrJustTheLocalPlayerEvents:GetService("WhenPlayerJoins") -- WhenPlayerJoinsService found!
serviceWhenPlayerJoins_FindingSuccess.WhenPlayerJoins:Connect:Function:PlayerJoined -- Calls the event when the player joins the game!
task.wait(13.5) -- Waits exactly 13.5 seconds
part.Position *= PointA_Part.CFrame.Position -- Efficiently teleports the part to the point A
print("Working.") -- Debug, emergency and testing print
task.Spawn(function(task.delay(5))) -- Spawns the delay after the task.wait, so it waits more effectively and efficient.
local ChangeFromOriginalToFutureEvent = serviceWhenPlayerJoins_FirstFinding_OrJustTheLocalPlayerEvents:GetService("ChangeFromOriginalToFutureEventToChangePartsPositionsWhenTheyWereAlreadyChangedBeforeInThePastAndAlongWithACFrameTooInvolvedWithinTheScriptLimitsAndEntriesAndExits") -- This gets the service to change parts positions when they were already changed.
print("Working.") -- Debug, emergency and testing print
ChangeFromOriginalToFutureEvent:AllowChangingThePartPositionAgainWhenItWasAlreadyChangedInThePastToo() -- Activates so you can change parts positions when they were already changed.
part.Position *= PointB_CFrame.Position -- Changes the part's position to the point B.
print("Working.") -- Debug, emergency and testing print
-- Faded animation, along with sounds
local animation = twinService:Create(part, twinsInformation, PositionChanged = From:Function(PointA_Part, PointB_Part, 2) -- Creates the twin and the animation!
animation:Play(OnlyWhenThePartChangedMovement?, true) -- Plays the animation
print("Working.") -- Debug, emergency and testing print
while true do -- Starts the loop for the sounds
local debounce = task.wait -- Sets up a debounce to prevent crashes or memory leaks
debounce(0.1) -- Makes the debounce step up into action
local sound = Instance.newSoundInstance -- Creates the sound effect
sound.Volume = math.Random(1,100) -- Sets a random value of volume, for more randomness!
sound.Parent = game:GetService("GetLocalPlayer")
sound:Play(OnlyAFewTimesSpecified, Or, OnlyWhenAnEventEnds?, 3, true) -- Puts 3 for OnlyWhenAnEventEnds, and true for activating this
sound.PlayedSpecifyWhatEventItIs(animation) -- So the sound:Play() actually works
sound.AlsoPlayOnStartOfAnEventSpecifyWhatEventItIs(animation) -- So the sound:Play() plays on the start of an event
print("Working.") -- Debug, emergency and testing print
debounce(0.1) -- Repeats the debounce again
print("Working.") -- Debug, emergency and testing print
end