Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years 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
7
Answered by
Xapelize 2658 Moderation Voter Community Moderator
4 years ago
Edited 3 years 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 882 — 4y
0
oh my god im super duper dumb lmao MradmannMvip 50 — 4y
0
I'm glad to help! Xapelize 2658 — 4y
0
top ten answers of all time 123nabilben123 499 — 4y
Ad
Log in to vote
1
Answered by 4 years 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 2658 — 4y
0
but # before the word Luka_Gaming07 534 — 4y

Answer this question