2DWorlds Forums
Can we have a group of users that know both roblox and buildism lua... - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: 2DWorlds Discussion (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=10)
+--- Thread: Can we have a group of users that know both roblox and buildism lua... (/showthread.php?tid=5789)



Can we have a group of users that know both roblox and buildism lua... - McNoobster - 06-14-2011

Transform scripts for people?

Because I have lots of cool scripts that I think would be cool on here


RE: Can we have a group of users that know both roblox and buildism lua... - broloxer - 06-14-2011

(06-14-2011, 03:45 AM)McNoobster Wrote: Transform scripts for people?

Because I have lots of cool scripts that I think would be cool on here

Scripter does a good job at transfering, also reading the wiki and finding the functions might help.

Here, give me one and I'll try to change it.


RE: Can we have a group of users that know both roblox and buildism lua... - McNoobster - 06-14-2011

[[lua]

--[[----Circle script, by xLEGOx---------
INSTRUCTIONS:
set "rad" to the distance between the center of the cicle and the outer edge
set "reps" to the ammount of bricks in the circle

press the "play" button

and your circle will be created, yays =P
]]

local bin = script.Parent
local orig = bin.Position
script.Parent = game.Workspace

local m = Instance.new("Model")
m.Parent = game.Workspace

----Set these----
local rad = 30
local reps = 30
--------------------

for i = 0, math.pi*2, math.pi*2/reps do
local a = bin:clone()
a.Position = orig+Vector3.new(rad*math.sin(i), 0, rad*math.cos(i))
a.CFrame = CFrame.new(a.Position, orig)
a.Anchored = true
a.Parent = m
end

print("done")

[/lua]


RE: Can we have a group of users that know both roblox and buildism lua... - broloxer - 06-14-2011

(06-14-2011, 03:54 AM)McNoobster Wrote: [[lua]

--[[----Circle script, by xLEGOx---------
INSTRUCTIONS:
set "rad" to the distance between the center of the cicle and the outer edge
set "reps" to the ammount of bricks in the circle

press the "play" button

and your circle will be created, yays =P
]]

local bin = script.Parent
local orig = bin.Position
script.Parent = game.Workspace

local m = Instance.new("Model")
m.Parent = game.Workspace

----Set these----
local rad = 30
local reps = 30
--------------------

for i = 0, math.pi*2, math.pi*2/reps do
local a = bin:clone()
a.Position = orig+Vector3.new(rad*math.sin(i), 0, rad*math.cos(i))
a.CFrame = CFrame.new(a.Position, orig)
a.Anchored = true
a.Parent = m
end

print("done")

[/lua]

Um...

._.


RE: Can we have a group of users that know both roblox and buildism lua... - lol - 06-14-2011

Too lazy to learn, however, I'll guess I'll look at some scripts.


RE: Can we have a group of users that know both roblox and buildism lua... - AK-47 - 06-14-2011

The script above would only work for 2D environments.

If you wheel, this would be hard to re-make.
*If you wanted a wheel


RE: Can we have a group of users that know both roblox and buildism lua... - Jacob__mybb_import1 - 06-14-2011

[lua]
local part = script.Parent
local orig = part.Position
script.Parent = game.World

local m = create("Model")
m.Parent = game.World

local rad = 30
local reps = 30

for i = 0, math.pi*2, math.pi*2/reps do
local a = part:clone()
a.Position = orig:add(Vec2D(rad*math.sin(i), rad*math.cos(i)))
v = a.PositionConfusedub(orig).normalized
a.Rotation = math.deg(math.atan2(v.y, v.x))
a.Fixed = true
a.Parent = m
end
[/lua]

Put the script in a part, and it will make a hollow circle around it out of that part. Works with boxes and circles.


RE: Can we have a group of users that know both roblox and buildism lua... - McNoobster - 06-14-2011

(06-14-2011, 02:01 PM)Jacob_ Wrote: [lua]
local part = script.Parent
local orig = part.Position
script.Parent = game.World

local m = create("Model")
m.Parent = game.World

local rad = 30
local reps = 30

for i = 0, math.pi*2, math.pi*2/reps do
local a = part:clone()
a.Position = orig:add(Vec2D(rad*math.sin(i), rad*math.cos(i)))
v = a.PositionConfusedub(orig).normalized
a.Rotation = math.deg(math.atan2(v.y, v.x))
a.Fixed = true
a.Parent = m
end
[/lua]

Put the script in a part, and it will make a hollow circle around it out of that part. Works with boxes and circles.

Thanks


RE: Can we have a group of users that know both roblox and buildism lua... - Qwertygiy - 06-14-2011

I'm pretty good at both -- I wrote that wiki article.