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

How to make a 2D-3D script? [closed]

Asked by 11 years ago

Like you start off at 2D and then you're going to another area and turns 3D view

Closed as Not Constructive by Articulating and evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 11 years ago

Ok listen Carefully!

Step 1: Put 2 Bricks

Step 2: 2D, Place this script one of your bricks

01local ting = 0
02 
03function GetMass(object)
04    local mass = 0
05    if pcall(function() return object:GetMass() end) then
06        mass = object:GetMass()
07    end
08    for _,child in pairs(object:GetChildren()) do
09        mass = mass + GetMass(child)
10    end
11    return mass
12end
13 
14 
15function onTouch(part)
View all 51 lines...

in the SAME brick, create a new localscript (advanced Objects -> localscript) and copy this to local script

01lockCamera = false
02    distance = 30
03    height = 5
04 
05local torso = script.Parent.Torso
06local center = Instance.new("Part")
07center.Name = script.Parent.Name .. " Center"
08center.Transparency = 1
09center.CanCollide = false
10center.Size = Vector3.new(1,1,1)
11center.CFrame = CFrame.new(Vector3.new(0,0,0),Vector3.new(0,0,-1))
12center.Position = torso.Position
13center.Parent = game.Workspace
14local bp = Instance.new("BodyPosition")
15bp.position = center.Position
View all 39 lines...

Step 3: changing 3D

Ok now go to your second brick, create a script and copy this

01local ting = 0
02 
03function onTouch(part)
04    local human = part.Parent:findFirstChild("Humanoid")
05    if (human == nil) then return end
06    if ting == 0 and human.Parent.LocalScript ~= nil then
07        ting = 1
08        script.Parent.Reflectance = 0.1
09        local charitem = human.Parent:GetChildren()
10        for i = 1, #charitem do
11            if charitem[i].Name == "LocalScript" then
12                charitem[i]:remove()
13            end
14        end
15        local torsoitem = human.Parent.Torso:GetChildren()
View all 31 lines...

Now at advanced objects, create a camera and rename to Instance, put the camera to 3D Script

Step 4: Test it, Got problems? reply

Ad