Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 8,079
» Latest member: seanac11
» Forum threads: 10,350
» Forum posts: 91,276
Full Statistics
|
Online Users |
There are currently 255 online users. » 0 Member(s) | 253 Guest(s) Bing, Google
|
Latest Threads |
I'm leaving the site too....
Forum: 2DWorlds Discussion
Last Post: Jacob_
07-03-2023, 04:59 AM
» Replies: 12
» Views: 6,230
|
hi there.
Forum: 2DWorlds Discussion
Last Post: Jacob_
01-03-2020, 04:30 AM
» Replies: 1
» Views: 714
|
obroke
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 10:11 AM
» Replies: 0
» Views: 20,511
|
fcouldn't
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 09:02 AM
» Replies: 0
» Views: 8,223
|
qhow
Forum: Current Games
Last Post: PhilipShums
09-06-2017, 07:25 AM
» Replies: 0
» Views: 2,101
|
zstone
Forum: Current Games
Last Post: TimothyTox
09-06-2017, 07:03 AM
» Replies: 0
» Views: 968
|
vbit
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 03:00 AM
» Replies: 0
» Views: 947
|
sildenafil 100 mg sandoz
Forum: Current Games
Last Post: RichardLen
09-06-2017, 12:28 AM
» Replies: 0
» Views: 1,155
|
mhis
Forum: Current Games
Last Post: TimothyTox
09-05-2017, 04:09 PM
» Replies: 0
» Views: 976
|
sildenafil citrate 100mg ...
Forum: Current Games
Last Post: Waltertog
09-05-2017, 12:27 PM
» Replies: 0
» Views: 931
|
|
|
[RESOURCE][SKINS][LUA] Casual Team Skins |
Posted by: Ghosty - 10-04-2012, 04:33 PM - Forum: 2DWorlds Discussion
- Replies (2)
|
 |
I took a few minutes earlier today to create a set of basic skins for new users / team-based games. I already had the basic template created, so I tweaked shirt and hair colors to give more variety.
![[Image: 21.png]](http://2dworlds.org/asset/21.png) ![[Image: 26.png]](http://2dworlds.org/asset/26.png) ![[Image: 31.png]](http://2dworlds.org/asset/31.png)
For users:
Choose the one you want and click "Add to My Stuff" to use. Then, go to the Change Character page and click "Use Skin".
Dark brown / black hair, blue shirt
Dark brown / black hair, red shirt
Dark brown / black hair, yellow shirt
Dark brown / black hair, green shirt
Blonde hair, blue shirt
Blonde hair, red shirt
Blonde hair, yellow shirt
Blonde hair, green shirt
Light brown hair, blue shirt
Light brown hair, red shirt
Light brown hair, yellow shirt
Light brown hair, green shirt
For game makers:
This script adds 4 teams to your game: Red, Blue, Yellow, and Green. Every player who joins gets added to one of these teams, and gets a skin of their team color. You can disable any team by setting the "use[color]team = true" line to false instead.
Code: local teams = game:getService("Teams")
local red = teams:getChild("Red Team")
local blue = teams:getChild("Blue Team")
local yellow = teams:getChild("Yellow Team")
local green = teams:getChild("Green Team")
local useredteam = true
local useblueteam = true
local useyellowteam = true
local usegreenteam = true
local redshirts = {22, 26, 30}
local blueshirts = {21, 25, 29}
local yellowshirts = {23, 27, 31}
local greenshirts = {24, 28, 32}
if red == nil and useredteam == true then
red = create("Team")
red.Name = "Red Team"
red.Color = Color(255, 0, 0)
red.Parent = teams
end
if blue == nil and useblueteam == true then
blue = create("Team")
blue.Name = "Blue Team"
blue.Color = Color(0, 0, 255)
blue.Parent = teams
end
if yellow == nil and useyellowteam == true then
yellow = create("Team")
yellow.Name = "Yellow Team"
yellow.Color = Color(255, 255, 0)
yellow.Parent = teams
end
if green == nil and usegreenteam == true then
green = create("Team")
green.Name = "Green Team"
green.Color = Color(0, 255, 0)
green.Parent = teams
end
function getEmptiestTeam()
local reds = 0
local blues = 0
local yellows = 0
local greens = 0
local players = game.Players:getChildren()
for q = 1, #players do
if players[q].Stats:getChild("Team") ~= nil then
if players[q].Stats.Team.Value == "Red Team" then
reds = reds + 1
elseif players[q].Stats.Team.Value == "Blue Team" then
blues = blues + 1
elseif players[q].Stats.Team.Value == "Yellow Team" then
yellows = yellows + 1
elseif players[q].Stats.Team.Value == "Green Team" then
greens = greens + 1
end
end
end
if greens < yellows and greens < blues and greens < reds and usegreenteam == true then
return green
elseif yellows <= greens and yellows < blues and yellows < reds and useyellowteam == true then
return yellow
elseif blues <= greens and blues <= yellows and blues < reds and useblueteam == true then
return blue
elseif reds <= greens and reds <= yellows and reds <= blues and useredteam == true then
return red
else
error("No available teams!")
end
end
function changeSkin(p)
while p.Character == nil or p.Character.Health == 0 or p:getChild("Stats") == nil or p.Stats:getChild("Team") == nil do
sleep(0.01)
end
if p.Stats.Team.Value == "Red Team" then
p.Character.Skin = "http://2dworlds.org/asset/file/" .. tostring(redshirts[math.random(1, #redshirts)]) .. ".png"
elseif p.Stats.Team.Value == "Blue Team" then
p.Character.Skin = "http://2dworlds.org/asset/file/" .. tostring(blueshirts[math.random(1, #blueshirts)]) .. ".png"
elseif p.Stats.Team.Value == "Yellow Team" then
p.Character.Skin = "http://2dworlds.org/asset/file/" .. tostring(yellowshirts[math.random(1, #yellowshirts)]) .. ".png"
elseif p.Stats.Team.Value == "Green Team" then
p.Character.Skin = "http://2dworlds.org/asset/file/" .. tostring(greenshirts[math.random(1, #greenshirts)]) .. ".png"
else
print("Improper team stat value for " .. p.Name)
end
end
function addTeam(p)
link(p.Died, function()
changeSkin(p)
end)
local stats = p:getChild("Stats")
while stats == nil do
sleep(0.01)
end
local teamvalue = stats:getChild("Team")
if teamvalue == nil then
teamvalue = create("TextValue")
teamvalue.Name = "Team"
teamvalue.Parent = stats
end
teamvalue.Value = getEmptiestTeam().Name
changeSkin(p)
end
link(game.Players.ChildAdded, addTeam)
|
|
|
Tutorial: Basic Editor Usage |
Posted by: Jacob__mybb_import1 - 09-29-2012, 08:33 PM - Forum: Help
- No Replies
|
 |
To make games on 2DWorlds, you use the Game Editor. There are two ways to access the editor:
- Go to your profile, and find an empty game. Click "Build."
- Click "Launch Editor" in the top right corner of your screen.
Once you're in the editor, you'll notice a row of buttons at the top of the screen, called the toolbar. Here's what it should look like:
![[Image: Labeled_Editor_Screenshot.PNG]](http://2dworlds.org/w/images/0/01/Labeled_Editor_Screenshot.PNG)
- New game
- Open game
- Save game to your computer
- Copy selected objects
- Cut selected objects
- Paste the objects that you have copied
- Group/ungroup selection
- Arrow-select/move parts
- Hand - grab parts (only works when physics are running)
- Resize - change the size of boxes that you have already placed
- Rotate
- Build box
- Build circle
- Place hinge
- Place weld
- Place rope (click then drag)
- Place water
- Place ladder
- Place seat
- Create terrain
- Start/stop physics simulation
- Show/hide grid
- Enable/disable snapping parts to grid
- Draw in front of parts
Buttons 8-20 control the mouse mode; only one can be selected at a time.
To place boxes, circles, water, or ladders, click and drag your mouse.
To place a weld or hinge, click where two parts (and ONLY two parts) intersect.
To place a rope, click and drag the mouse from one part to another.
You can move the camera by clicking your right mouse button and dragging. If you want to zoom in or out, use the scroll wheel or press the +/- keys.
A: If you wish to test your game, click the Add Character button. Make sure physics are running (button 21). Click again to remove your character.
B: You can change some more properties of parts by using the advanced tools; click the pencil icon on the left to access them. Select the parts you want to change by click them, or select multiple ones by clicking the left mouse button and dragging. The table at the bottom lists all of the properties you can change. If you don't understand what a property means, go to the Object List on our wiki.
Some useful properties to know:
- Fixed: If this is set to 'true', the part will not be affected by physics. It won't rotate and it won't move.
- Collidable: If this is set to 'true', parts can hit and bounce against this part. If 'false', other parts will go though it and it will fall through other parts -- including the ground, unless it is Fixed (see above).
- CharacterCollide: If this is set to 'true', players can hit and bounce against this part. Collidable must be set to true for this to work though. If it is set to 'false', players can go through this part, even if Collidable is set to 'true'.
- MaxForce: If you change this value to something higher than 0, then impacts with enough force will 'shatter' this part into many smaller parts.
C: The Lua icon opens up the Scripting Console, which is a grey bar at the bottom of the editor. Type in a one-line Lua script and click "Run".
D: The box opens the Model Showcase, which contains several premade items that you can add to your game, such as lava, a spawner, a helicopter, a gun, or a chasing NPC.
As with any other programs, you should save often to ensure that you don't lose much work. To save to 2DWorlds.org, use the appropriate item in the file menu. However, it's a good idea to keep a copy on your local computer as well; to do this, use the save button. You can open saved games by using the open button and navigating to where you saved the file.
More relevant guides: Scripting, Welds, Textures
|
|
|
|