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

MEGA HELP! PLEASE? [Lots of Scripts included!]

Asked by
Vividex 162
9 years ago

In studio I have: DBlueStrobe Flash --Supposed to strobe the lights from the Parts and change the CFrame of the things (Sends it somewhere completely different and makes it go in circles

--vivdex
local fl = game.Workspace.DBlueStrobe.Model1.L1.PointLight
local sp = game.Workspace.DBlueStrobe.Model1.Cylinder
local s = game.Workspace.DBlueStrobe.Model1.L
local ss = game.Workspace.DBlueStrobe.Model1.L1
local sss = game.Workspace.DBlueStrobe.Model1.L2
local lighting = game.Lighting
while true do
    for z = 30,-30,-15 do
        local to = CFrame.new(-180,0,z);
        sp.CFrame = to;
        s.CFrame = to;
        ss.CFrame = to;
        sss.CFrame = to;
        wait(0.1);
    end
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
end
      Move --Just supposed to move the items
--Vividex
local sp = game.Workspace.DBlueStrobe.Model1.Cylinder
local s = game.Workspace.DBlueStrobe.Model1.L
local ss = game.Workspace.DBlueStrobe.Model1.L1
local sss = game.Workspace.DBlueStrobe.Model1.L2

while true do
    for z = 30,-30,-15 do
        local to = CFrame.new(-180,0,z);
        sp.CFrame = to;
        s.CFrame = to;
        ss.CFrame = to;
        sss.CFrame = to;
        wait(0.1);
    end
end

            Model
                Part
                   Part
                      Part
                         Part
               Model1
                   Cylinder
                       Mesh
                           PointLight
                   L
                      Mesh
                        Decal
                     L1
                      Mesh
                            PointLight
                              Decal
                      L2
                       Mesh
                            Decal

TurnOn -- Supposed to set the bricks transparency too 0 and make it change colors

--Vividex
local RF1 = game.Workspace.DBlueStrobe.Model1.L2
local RF2 = game.Workspace.DBlueStrobe.Model1.L1
game.Workspace.DBlueStrobe.Model1.L.Transparency = 0
wait(.1)
game.Workspace.DBlueStrobe.Model1.L1.Transparency = 0
wait(.1)
game.Workspace.DBlueStrobe.Model1.L2.Transparency = 0
wait(.1)
while true do
    RF1.BrickColor.random()
    wait(.1)
    RF2.BrickColor.random()
end

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

Have you really not done any debugging on your own?

Your first script can be significantly simplified.

videx
local fl = game.Workspace.DBlueStrobe.Model1.L1.PointLight
local sp = game.Workspace.DBlueStrobe.Model1.Cylinder
local s = game.Workspace.DBlueStrobe.Model1.L
local ss = game.Workspace.DBlueStrobe.Model1.L1
local sss = game.Workspace.DBlueStrobe.Model1.L2
while true do
    for z = 30,-30,-15 do
        local to = CFrame.new(-180,0,z);
        sp.CFrame = to;
        s.CFrame = to;
        ss.CFrame = to;
        sss.CFrame = to;
        wait(0.1);
    end
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
    fl.Parent = Lighting
    wait(.3)
    Lighting.fl.Parent = Workspace
    wait(.3)
end

Lighting was never defined in this script. You should define it initially as local Lighting = game.Lighting.


BrickColor cannot be set to a Color3 value. Construct a new BrickColor (i.e., BrickColor.new(somecol3)) or just use BrickColor.random() to generate a random BrickColor.


Disabling/enabling scripts is completely the wrong way to make them run. That will not work. Use global functions, bindable functions, or booleans with loops.

0
I made it local lighting and changed the CFrame part which you said, I also changed the Move Script and the TurnOn script and changed it to BrickColor.random(). Though, it does not put the Pointlight into the lighting and bring it back, nor does it change color. Also, when I try to run it, it makes the position go to -180, 0, and the last number varies from 0 to -30 and goes it a straight line w Vividex 162 — 9y
0
It also says in output: random is not a valid member (and) Workspace.DBlueStrobe.Flash:19: attempt to index global 'Lighting' (a nil value) Vividex 162 — 9y
0
I think I've found the problem with the movement, I think its because CFrame is for position of something and I'm trying to rotate the item. Vividex 162 — 9y
Ad

Answer this question