i've been Working in an optimized script ffor my sinking ship game but it just doesn't work. No error messages. No warnings. F in the chat.
--variables local ship = script.Parent local P = ship.PrimaryPart local SeaLevel = 0 --scripting local function sink() while true do local X = P.Position.X local Y = P.Position.Y local Z = P.Position.Z if ship.Trigger1.Position >SeaLevel then ship:SetPrimaryPartCFrame( P.CFrame * CFrame.Angles( math.rad(.01),0,math.rad(.01) ) ) ship:SetPrimaryPartCFrame( P.CFrame + Vector3.new( X,Y -.05,Z ) ) wait() end end end
You did not execute the function, but made the function. that's why it doesn't work. Consider inserting this to your last line:
sink()
You only defined a funtion as sink()
to do that you need to add:
sink()