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

Nothing happens but there is not an output, why?

Asked by
Nidoxs 190
8 years ago

This is an extract of my bigger script but this part of it should 1, Get the clickers name and print it, 2, check if the clickers name is any of the written strings. 3, Get all parts of a model and put them into a table and 4, rotate the model with the mod and angle. I put print("Done") to see which lines worked and didn't it only got up to, however it only got up to 4 "dones" which means line 5 of this script must be an error? Also this is a normal server script.

This is the broken line according to the print algorithm. local function rotateMod(mod,center,rotation)

This is the extracted code:

local cn = click.Name  print("Done") --1
print(click.Name)  print("Done") --1
if click.Name == "doctorbenny2011" or click.Name == "CaptainTheTimeLord" or click.Name ==   "Player" or click.Name == "Player1" or click.Name == "mim033" then print("Done")  -- 2    

local game1 = script.Parent.Controls.Matlever.lever print("Done") --3
local function rotateMod(mod,center,rotation)  print("Done")
    local parts = {}  print("Done")
      function scan(parent)  print("Done")
        for _,obj in pairs(parent:GetChildren()) do  print("Done")
            if (obj:IsA("BasePart")) then  print("Done")
                table.insert(parts,obj)
            end
            scan(obj)
        end
    end
    scan(mod)
    for _,part in pairs(parts) do
        part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
    end
end

local mod = game1 --4
local step = 1
if script.Parent.Variables.Power.Value == true and script.Parent.Variables.Override.Value == false then
    if status.Value == 1 then
        status.Value = 2
        matlever:Play()
for i = 0,9,step do
    rotateMod(mod,mod:GetModelCFrame(),CFrame.Angles(0,0.2,0))
wait()
end
0
It's a lot more helpful if you print different messages, so you are *sure* which ones are happening. It's also helpful if you provide enough context for this to compile. BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
8 years ago

You are missing ends! Don't expect an answer on this site unless you format your code properly...

local cn = click.Name  print("Done") --1
print(click.Name)  print("Done") --1
if click.Name == "doctorbenny2011" or click.Name == "CaptainTheTimeLord" or click.Name ==   "Player" or click.Name == "Player1" or click.Name == "mim033" then print("Done")  -- 2    

    local game1 = script.Parent.Controls.Matlever.lever print("Done") --3

    local function rotateMod(mod,center,rotation)  print("Done")
        local parts = {}  print("Done")

        function scan(parent)  print("Done")
            for _,obj in pairs(parent:GetChildren()) do  print("Done")
                if (obj:IsA("BasePart")) then  print("Done")
                    table.insert(parts,obj)
                end
            scan(obj)
            end
        end

        scan(mod)

        for _,part in pairs(parts) do
            part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
        end
    end

    local mod = game1 --4
    local step = 1
    if script.Parent.Variables.Power.Value == true and script.Parent.Variables.Override.Value == false then
        if status.Value == 1 then
        status.Value = 2
        matlever:Play()
            for i = 0,9,step do
                rotateMod(mod,mod:GetModelCFrame(),CFrame.Angles(0,0.2,0))
                wait()
            --you are missing several 'end's here. Do you see why proper code formatting is so important?
end

0
Even WITH the ends' it wont work. Nidoxs 190 — 8y
0
@doctor You did fill in the area where the ends were supposed to go, right? You're not just expecting him to do the work for you. M39a9am3R 3210 — 8y
0
I'm not looking at your code if it isn't even important enough for you to format it correctly. If it isn't worth your time, it isn't worth mine. Validark 1580 — 8y
Ad

Answer this question