Ad
Log in to vote
1

The Thing doesnt move???? what the hecc???

Asked by 1 year ago

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

2 answers

Log in to vote
5
Answered by
Xapelize 1080 Moderation Voter
1 year ago
Edited 13 days ago

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()
0
i rate this post 11/10 Psudar 868 — 1y
0
oh my god im super duper dumb lmao MradmannMvip 50 — 1y
0
I'm glad to help! Xapelize 1080 — 1y
0
top ten answers of all time 123nabilben123 497 — 1y
0
Hello. If you found out this, I have edited the answer for a more detailed/ formal explanation. Thank you for reading. Xapelize 1080 — 13d
Ad
Log in to vote
0
Answered by 1 year ago

You didnt call the function

You only defined a funtion as sink()

But you didnt actually call it.

to do that you need to add:

sink()
0
How did you make huge words? Xapelize 1080 — 1y
0
but # before the word Luka_Gaming07 529 — 1y

Answer this question