generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Terminal

Previous Thread :: Next Thread 
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 06:26 PM
Everything works except for if the raiders loose it, and re-capture it it doesnt work
Ill mark where the count is

wait(5)
--PUT EXACT TEAM NAMES--
raiders = "Hostile/Raider"
none = "Visitors/Allies"
group = "Furious Empire"
mins = 1 --minutes for raiders to win
victorymessagetime = 5 --seconds victory message is on
------VARIABLES--------
guiraid = false
mainteam = group
notcap = none
raid = raiders
on = true
count = false
-------Current Owner---------
function gooff(guii)
    guii.TimerFrame.Visible = false
                guii.TimerFrame.Time.Text = tostring(mins*60)
                on = true
    end
currentowner = mainteam
coroutine.resume(coroutine.create(function()
    while wait() do
        for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats
        local g = game.StarterGui.TerminalStats
        g.TimerFrame.Time.Text = gui.TimerFrame.Time.Text
        g.TimerFrame.Visible = gui.TimerFrame.Visible
        g.Stats.Raid.Text = gui.Stats.Raid.Text
        g.Stats.Owner.Text = gui.Stats.Owner.Text
        end end end))
coroutine.resume(coroutine.create(function() --count start
while wait() do
script.Parent.BrickColor = game.Teams[currentowner].TeamColor
end end))
coroutine.resume(coroutine.create(function()
    while wait() do
    if guiraid and count then
        print"Raiders Have Flag, Counting"
        gui.TimerFrame.Visible = true
        if count and guiraid then
        for i = mins*60, 1, -1 do
            for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats
            if gui:FindFirstChild("TimerFrame") and guiraid == true and count == true then
            gui.TimerFrame.Time.Text = tostring(i).. " Seconds"
            elseif guiraid == false then
                i = 0
                i = 1
                i = 0
                gooff(gui)
                guiraid = false
                count = false
            end
            wait(1)
            end
        end
        end
        local m = Instance.new("Message", workspace)
        on = false
        m.Text = "Hostile/Raider won this time! Try Harders Next Time Furious Empire"
        wait(victorymessagetime)
        m.Text = "Now, Crashing All Raiders"
        wait(8)
        m:remove()
        for i, v in ipairs(game.Players:children()) do if v.TeamColor == game.Teams["Hostile/Raider"].TeamColor then
        script.Crash:clone().Parent = v.Backpack
        print"Crashed"
        guiraid = false
        on = true
        elseif not guiraid then
        gui.TimerFrame.Visible = false gui.TimerFrame.Time.Text = tostring(mins*60)
        end
        end
    elseif not guiraid then
        for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats
        gui.TimerFrame.Visible = false
        gui.TimerFrame.Time.Text = tostring(mins*60)
        end end end end)) --count end
-----------------------------
script.Parent.Touched:connect(function(cha)
    print"Touched"
    if on then
    if cha.Parent:FindFirstChild("Humanoid") then
        local char = cha.Parent
        print"Char Found"
        local plr = game.Players[char.Name]
        print"Player Found"
        if (plr.TeamColor == game.Teams[currentowner].TeamColor) == false or (plr.TeamColor == game.Teams["Visitors/Allies"]) == false then
            print"Capturing"
            if (plr.TeamColor == game.Teams[raid].TeamColor) == true then
                print"Player Is Raider"
                currentowner = raid
                script.Parent.BrickColor = game.Teams["Hostile/Raider"].TeamColor
                guiraid = true
                count = true
                for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats
                gui.Stats.Owner.Text = "Current Owner: Hostile/Raider" end
                elseif (plr.TeamColor == game.Teams[group].TeamColor) then
                print"Player Is FE"
                currentowner = mainteam
                script.Parent.BrickColor = game.Teams["Furious Empire"].TeamColor
                for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats
                guiraid = false
                gui.Stats.Owner.Text = "Current Owner: Furious Empire" end
            end
            end
        end
    end
end)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 08:30 PM
b1
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 08:34 PM
A) It's 'lose' not 'loose'. Amazing how many people don't get that.
B) It's very difficult to help someone with a script that they didn't even make, especially when they just post a hundred lines of code and say it doesn't work.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 08:35 PM
I made the script.
100% from scratch,
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
09 Aug 2013 08:41 PM
He did make the script, He told you what part of those hundreds of lines of code that isnt working...
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 08:43 PM
^
madness knows I dont Take free models.
lol, I will go on join.me and show you HOW i made it.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 08:54 PM
Sorry, it's just a little characteristic of scripts not made by someone to have things like --PUT EXACT TEAM NAMES-- in them, so I assumed.

I suppose I'll take a look at it.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 09:00 PM
^
Its a request someone made.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 11:32 PM
I just read through all this code (copypasta'd it into notepad ++) and I think I'm going to cry... One day, you'll look back at this script and say "Oh god, the horror, what was I thinking?"
For now though, I will go through and rewrite the code, from scratch, fixing all your ridiculous ways and such. Boredom is a powerful motivator.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 11:37 PM
@Mhebes,
Check a newer forum by me.
It is shorter and has different updates.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 11:42 PM
I saw it - it has the same problems. I'm fixing dem nao. You wait.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 11:43 PM
Thanks alot
sorry for spamming
Anyway are you against new chat bar? If so,
Join
http://www.roblox.com/My/Groups.aspx?gid=929432
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 11:52 PM
If you want, I could add make it so that you have to be touching the brick for a certain amount of time before its captured.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 11:54 PM
I know how to do that.
If you want, you can do percentage that takes 10 seconds
I dont care.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
09 Aug 2013 11:59 PM
I won't, it would require making GUIs. Which I could do, but it'd be better if you did.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
10 Aug 2013 12:03 AM
I can make a frame called
"Precent" then in the frame a textlabel called "Text" if you want, your choice.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Aug 2013 12:16 AM
Maybe in the future but right now I need to know what you're doing to the raiders when you're crashing them.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
10 Aug 2013 12:18 AM
The crashing works
You dont want 10 raiders hanging out after they just won, they have their however long, then they must leave.
(Requested by person that wanted it)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
10 Aug 2013 12:19 AM
Its a localscript in the players backpack
The source is
repeat while true do end until nil
It should work

Could you tell me if my auto signature is working?
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Aug 2013 12:25 AM
I don't think your sig's working, no.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Aug 2013 12:30 AM
Also, change the crash's disabled property to true for me.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
10 Aug 2013 12:35 AM
Why?
And ok..
Itll nil first player who joins(due to localscript)
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Aug 2013 12:41 AM
Kay, I made it almost 40% shorter, removed the entire while loop, and made the whole thing nicer, really. Tell me if it doesn't work, along with what the output says.

wait(5) -- I don't think this is necessary, but you did, so kay

raidersTeamName = "Hostile/Raider" -- The team name of the raiders
defendingTeamName = "Furious Empire" -- The team name of the defenders
spectatorTeamName = "Visitors/Allies" -- The team name of the neutral players
timeNeededForWin = 60 -- Seconds the raiders need to hold the capture point to win
showVictoryMessageTime = 5 -- How long to display a victory message
waitAfterVictory = 8 -- How long after that message to wait until removing raiders
capturePoint = script.Parent -- The part to capture. If this script is inside that part, you don't have to change this.
--[[ From here on, you don't need to worry ]]--

teams = game:GetService("Teams")
captured = false
canCapture = true
currentOwner = teams[defendingTeamName]

function forAllPlayers(playerFunction,...)
for _,player in pairs(game.Players:GetPlayers()) do
playerFunction(player,...)
end
end

function isOnTeam(player,teamName) return player.TeamColor == teams[teamName] end
function updateColor() script.Parent.BrickColor = teams[currentOwner].TeamColor end

function capture(team)
currentOwner = team
updateColor()
forAllPlayers(function(player)
getGui(player).Stats.Owner.Text = "Current Owner:" .. team
end)
end

function getGui(player) return player.PlayerGui.TerminalStats end

script.Parent.Touched:connect(function(hit)
if canCapture then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and (not isOnTeam(player,spectatorTeamName)) and (not isOnTeam(player,currentOwner)) then
if isOnTeam(raidersTeamName) then
capture(raidersTeamName)
captured = true
for i = timeNeededForWin,1,-1 do
if captured then
forAllPlayers(function(player)
getGui(player).TimerFrame.Visible = true
getGui(player).TimerFrame.Time.Text = tostring(i) .. " Seconds"
end)
else break end
wait(1)
end
if captured then
canCapture = false
local m = Instance.new("Message",Workspace)
m.Text = raidersTeamName .. " have won! Try harder next time, " .. defendingTeamName .. "!"
wait(showVictoryMessageTime)
m.Text = "Crashing all raiders"
for i = 1,waitAfterVictory*10,.1 do
wait(.1)
m.Text = " ":rep(i%4) .. "Crashing all raiders" .. ".":rep(i%4)
end
forAllPlayers(function(player)
if isOnTeam(raidersTeamName) then
local s = script.Crash:Clone()
s.Disabled = false
s.Parent = player.Backpack
else
getGui(player).TimerFrame.Visible = false
end
end)
end
else
capture(defendingTeamName)
captured = false
forAllPlayers(function(player)
getGui(player).TimerFrame.Visible = false
end)
end
end
end
end)
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
10 Aug 2013 12:44 AM
Here it is with tabs, if ROBLOX wills it so.

wait(5) -- I don't think this is necessary, but you did, so kay

raidersTeamName = "Hostile/Raider" -- The team name of the raiders
defendingTeamName = "Furious Empire" -- The team name of the defenders
spectatorTeamName = "Visitors/Allies" -- The team name of the neutral players
timeNeededForWin = 60 -- Seconds the raiders need to hold the capture point to win
showVictoryMessageTime = 5 -- How long to display a victory message
waitAfterVictory = 8 -- How long after that message to wait until removing raiders
capturePoint = script.Parent -- The part to capture. If this script is inside that part, you don't have to change this.
--[[ From here on, you don't need to worry ]]--

teams = game:GetService("Teams")
captured = false
canCapture = true
currentOwner = teams[defendingTeamName]

function forAllPlayers(playerFunction,...)
for _,player in pairs(game.Players:GetPlayers()) do
playerFunction(player,...)
end
end

function isOnTeam(player,teamName) return player.TeamColor == teams[teamName] end
function updateColor() script.Parent.BrickColor = teams[currentOwner].TeamColor end

function capture(team)
currentOwner = team
updateColor()
forAllPlayers(function(player)
getGui(player).Stats.Owner.Text = "Current Owner:" .. team
end)
end

function getGui(player) return player.PlayerGui.TerminalStats end

script.Parent.Touched:connect(function(hit)
if canCapture then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and (not isOnTeam(player,spectatorTeamName)) and (not isOnTeam(player,currentOwner)) then
if isOnTeam(raidersTeamName) then
capture(raidersTeamName)
captured = true
for i = timeNeededForWin,1,-1 do
if captured then
forAllPlayers(function(player)
getGui(player).TimerFrame.Visible = true
getGui(player).TimerFrame.Time.Text = tostring(i) .. " Seconds"
end)
else break end
wait(1)
end
if captured then
canCapture = false
local m = Instance.new("Message",Workspace)
m.Text = raidersTeamName .. " have won! Try harder next time, " .. defendingTeamName .. "!"
wait(showVictoryMessageTime)
m.Text = "Crashing all raiders"
for i = 1,waitAfterVictory*10,.1 do
wait(.1)
m.Text = " ":rep(i%4) .. "Crashing all raiders" .. ".":rep(i%4)
end
forAllPlayers(function(player)
if isOnTeam(raidersTeamName) then
local s = script.Crash:Clone()
s.Disabled = false
s.Parent = player.Backpack
else
getGui(player).TimerFrame.Visible = false
end
end)
end
else
capture(defendingTeamName)
captured = false
forAllPlayers(function(player)
getGui(player).TimerFrame.Visible = false
end)
end
end
end
end)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
10 Aug 2013 12:44 AM
Thanks
ALOT.
You didnt need to go thorugh so much


Are you against new chat bar?
Join my primary or: http://www.roblox.com/My/Groups.aspx?gid=929432
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image