Aphox
|
  |
| Joined: 05 Apr 2012 |
| Total Posts: 4 |
|
|
| 16 Mar 2013 01:41 AM |
| How do I make team starterpacks? Like, when you join one team you get [this] and [this] and if you join another team you get [that] and [that] or something? I don't know how to make that, I've tried googling it and I didn't get very far with that. Could someone help me? |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2013 02:13 AM |
One easy way (Although not the most efficient) would be to put the items in the starterpack as usual, but post this script anywhere directly inside of the tool as well:
local player = script.Parent.Parent.Parent if player.TeamColor ~= "[Team Colour Here]" then script.Parent:remove() end
There are much more advanced and, for lack of a better word, more professional ways of doing this though. For example, you could create a leaderboard script which handles player respawns (eg. The default leaderboard script) and code it so that it checks to see what team the player is on and THEN gives them the tools. It all just depends on how advanced you want your place to be :3. If you want, I can try to make that Leaderboard aspect based just off of the default leaderboard- I think I have a version of it somewhere. |
|
|
| Report Abuse |
|
|
Aphox
|
  |
| Joined: 05 Apr 2012 |
| Total Posts: 4 |
|
|
| 16 Mar 2013 04:10 PM |
| I would much appreciate that. Thank you! If you want me to pay you I can for doing this for me...? I would like something like that, and I don't know how to do that. I plan on having quite the deal of teams, hopefully there is no limit... |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2013 06:28 PM |
| Sure I can rip apart my rpg leaderboard to find the part you meed. Officially the team have a limit of 64 (Each colour), but you can really make a many as you want by creating a team value to be saved inside of the player and revolving everything around that. I'll post asap. |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2013 03:56 PM |
Okay, so use the same leaderboard as the default (Customize the scores or whatever, you don't even need to have scores and such) And replace the OnHumanoidDied function with this:
function onHumanoidDied(humanoid, player) local stats = player:findFirstChild("leaderstats") if stats ~= nil then local deaths = stats:findFirstChild("Wipeouts") deaths.Value = deaths.Value + 1
-- do short dance to try and find the killer
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
handleKillCount(humanoid, player) end
--Give Weapons while checkRespawned(player) == false do wait(0.1) if checkRespawned(player) == true then if player.TeamColor == [Team Color] then local backpack = player:findFirstChild("Backpack")
local newtool = game.Lighting.[ToolHere]:clone() newtool.Parent = backpack end end end end
Also, paste this somewhere before that, preferably at the top:
function checkRespawned(player) if player.Character ~= nil then local character = player.Character if character:findFirstChild("Humanoid") ~= nil then local humanoid = character:findFirstChild("Humanoid") if humanoid.Health > 0 then return(true) else return(false) end else return(false) end else return(false) end end
--------------------------------------------------------------------------------------------------------------
Basically just put the tools into game.Lighting, and change the script from there :3. All you have to change is the [TeamColor] part, and the [ToolHere] part in the OnHumanoidDied function. |
|
|
| Report Abuse |
|
|