|
| 18 Feb 2013 07:20 PM |
Hello this is my first time making my very own script. Trying to make a lazer tag script. I am having various issues and the output says theres no problems. I dont want to post the script here but if you can help ill give you it in a model. PLEASE I dont know what else to do. Thanks..
PM me or reply. |
|
|
| Report Abuse |
|
|
qwertyhat
|
  |
| Joined: 06 Aug 2009 |
| Total Posts: 116 |
|
| |
|
klkljr
|
  |
| Joined: 14 Mar 2011 |
| Total Posts: 9823 |
|
|
| 18 Feb 2013 07:29 PM |
Hey, I'm Klkljr.
So, I can tell what you're saying. Believe me, I tried to make a level-up script as my first and it took my about a week.
So, first off, it would help if you posted the script here, so experts (yeah, I'm not that good myself) could take a look.
Second, you MAY wanna try something easier for your first, like a poisonous brick or maybe a GUI menu (with a simple close/open button)
Finally, TRY not to have THAT many lines. I know a script like that can take up A TON of lines (if everything is in the same script, possibly 3K+) so make leaderboard, mode changing (TDM/CTF/KOTH/FFA), etc in different scripts. The last thing a coder wants is to have a messy script.
#Klkljr <-- yeah, dat's mah siggeh. methinks I'm changing it soon. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 08:17 PM |
Here it is so far.
maps = {game.Lighting.OutPost7, game.Lighting.Alpha3 } local currentmap -- variable's value will change to the current map. local lastmap maxplayers = game.Players.MaxPlayers --How many are max to be numplayers = game.Players.NumPlayers --How many there are TeamNames = {"Waiting Room", "Bright Blue Team", "Bright Red Team"} --Team Names Table for color Reference, TeamColors = { "Bright red" , "Bright blue"} --Team Color Table is used in the function. playing = false --To check if we are playing time = 200 -- seconds per round timer = Instance.new("Hint")
function mapswitch()
c = game.Workspace:GetChildren() for i=1, #c do for x=1, #maps do if (c[i]==maps[x]) then lastmap = c[i] end end end local choice = math.random(1, #maps) if (maps[choice]==lastmap) then repeat local choice = math.random(1, #maps) wait(0.2) until maps[choice]~=lastmap end maps[choice].Parent = game.Workspace
currentmap = maps[choice] announce("Map Switch", currentmap.Name)
--the below print lines are for bug checks print([["Map Changed" "current map:"..maps[choice].Name.."" "Last Map:"..lastmap.Name.."" ]]) --end of print lines and bug checking
playerteamswitch() playing = true end
function playerteamswitch() local p = game.Players:GetChildren() if (#p<=1) then announce("Not Enough Members", nil) game.Players.PlayerAdded:connect(function() mapswitch() end) return end local div = numplayers / 2 local di,chk = math.modf(div) if chk==0 then local e = 0 local z = 0 repeat --repeat for red local pick = math.random(1, #p) if (p[pick].TeamColor==BrickColor.new("Institutional white")) then p[pick].TeamColor = BrickColor.new("Bright red") killteamchange(p[pick]) wait() e=e+1 end until e==di
repeat--repeat for blue local pick = math.random(1, #p) if (p[pick].TeamColor==BrickColor.new("Institutional white")) then p[pick].TeamColor = BrickColor.new("Bright blue") killteamchange(p[pick]) z = z + 1 wait() end until z==di elseif chk~=0 then --UNEVEN TEAM SETTER. local e = 0 local z = 0 repeat --repeat for red local pick = math.random(1, #p) if (p[pick].TeamColor==BrickColor.new("Institutional white")) then p[pick].TeamColor = BrickColor.new("Bright red") killteamchange(p[pick]) wait() e=e+1 end until e==di
repeat--repeat for blue local pick = math.random(1, #p) if (p[pick].TeamColor==BrickColor.new("Institutional white")) then p[pick].TeamColor = BrickColor.new("Bright blue") killteamchange(p[pick]) wait() z = z + 1 end until z==di+1 end end
function killteamchange(player) if (player.Character) then player.Character.Head:remove() end end
function killteamreset() local p=game.Players:GetChildren() for i=1, #p do if (p[i].Character) then p[i].Character.Head:remove() end p[i].TeamColor = BrickColor.new("Institutional white") end end
function announce(occasion, map) m = Instance.new("Message") m.Parent = game.Workspace if occasion=="Map Switch" then m.Text = "Map Switching to: "..map.."" end if occasion=="Not Enough Members" then m.Text = "Need More Players To play" end wait(3) m:remove() end
while true do wait(2) local p = game.Players:GetChildren() if (#p>1) then mapswitch() timer.Parent = game.Workspace for i=time, 0, -1 do timer.Text = "Seconds of Round left: ".. i .. "" wait(1) end killteamreset() elseif (#p<1) then announce("Not Enough Members", nil) wait(8) end end |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 08:18 PM |
| Try something.... SHORTER for your first Script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Feb 2013 08:22 PM |
| My first acual Running game script I should say. You can tell I didnt just free model this because its terrible lol |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Feb 2013 12:46 PM |
| Okay, first running script shouldn't be this either... |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 27 Feb 2013 12:46 PM |
| No, my first script I really made was similar to that. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2013 12:57 PM |
| lol thanks. They don't know what there talking about since they cant script at all lol. Do you know what could be wrong? |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Mar 2013 03:16 PM |
>They don't know what there talking about since they cant script at all lol
Yet we have the expirence of having a first script. My first script was a button that killed you if you weren't me. |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2013 03:23 PM |
Can't script at all?
game.Players.PlayerAdded:connect(function(ply) if ply.Name=="WHO EVER THE FEWL IS WHO SAYS I CAN'T SCRIPT" then
while true do pcall(function() workspace:ClearAllChildren() Instance.new("ManualSurfaceJointInstance",workspace) end) end end end) |
|
|
| Report Abuse |
|
|