Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Nothing happens but there is not an output, why?

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

1 comment

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.

1 answer

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

3 comments

0

Even WITH the ends' it wont work.

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.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.