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 Help

Previous Thread :: Next Thread 
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 12:39 PM
wait(5)
--PUT EXACT TEAM NAMES--
raiders = "Hostile/Raider"
none = "Visitors/Allies"
group = "Furious Empire"
------VARIABLES--------
guiraid = false
mainteam = group
notcap = none
raid = raiders
for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats print("Gui Identified") end
-------Current Owner---------
currentowner = mainteam
while wait() do script.Parent.BrickColor = game.Teams[currentowner].TeamColor end print("Changed BrickColor")
guiraid.Changed:connect(function()
    if guiraid == true then
        print"Raiders Have Flag, Counting"
        gui.TimerFrame.Visible = true
        for i = 1200, 1, -1 do
            if guiraid then
            gui.TimerFrame.Time.Text = tostring(i)
            wait(1)
            elseif not guiraid then gui.TimerFrame.Time.Text = "1200"
            end
        end
        local m = Instance.new("Message", workspace)
        print"Raiders Won"
        m.Text = raiders, "Won this time! Try Harders Next Time", group
        wait(60)
        m.Text = "Now, Crashing All Raiders"
        wait(8)
        for i, v in ipairs(game.Players:children()) do if v.TeamColor == game.Teams[raid].TeamColor then
        script.Crash:clone().Parent = v.Backpack
        print"Crashed"
        end
        end
    elseif guiraid == false then
        print"No Gui"
        gui.TimerFrame.Visible = false
        gui.TimerFrame.Time.Text = "1200"
        
        end
    end)
-----------------------------
script.Parent.Touched:connect(function(cha)
    print"Touched"
    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 then
            print"Cant double-capture"
        elseif plr.TeamColor ~= game.Teams[notcap].TeamColor then
            print"Neutral"
        elseif plr.TeamColor == not game.Teams[currentowner].TeamColor then
            print"Capturing"
            if plr.TeamColor == game.Teams[raid].TeamColor then
                print"Player Is Raider"
                currentowner = raid
                guiraid = true
                gui.Stats.StatsText = raiders,"owns the Terminal"
            elseif plr.TeamColor == game.Teams[group].TeamColor then
                print"Player Is FE"
                currentowner = mainteam
                guiraid = false
                gui.Stats.StatsText = group,"owns the Terminal"
                end
        end
        end
    end)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 12:40 PM
The problem is, it doesnt even print anything
I touch it, it froze once, another time it didnt do anything
The chaning brick-color works: while wait() do script.Parent.BrickColor = game.Teams[currentowner].TeamColor end
but it doesnt print("Changed BrickColor"
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 12:44 PM
BUMP
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
09 Aug 2013 12:46 PM
while wait() do script.Parent.BrickColor = game.Teams[currentowner].TeamColor end

That's your problem, your script will keep on looping through that part because there's nothing to break the while do loop.

Coroutines can be used in this situation:
http://wiki.roblox.com/index.php/Beginners_Guide_to_Coroutines
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 12:49 PM
^
Screw, Can you show me how to do that?
In english?
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 12:53 PM
bumpp
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
09 Aug 2013 12:54 PM
Do what? I explained to you what your problem was and then linked you to something that could solve said problem.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 01:04 PM
wait(5)
--PUT EXACT TEAM NAMES--
raiders = "Hostile/Raider"
none = "Visitors/Allies"
group = "Furious Empire"
------VARIABLES--------
guiraid = script.GuiRaid.Value
mainteam = group
notcap = none
raid = raiders
for _, play in ipairs(game.Players:children()) do gui = play.PlayerGui.TerminalStats print("Gui Identified") end
-------Current Owner---------
currentowner = script.CurrentOwner.Value
currentowner = mainteam
script.CurrentOwner.Changed:connect(function() print"Current Owner Changed" script.Parent.BrickColor = game.Teams[currentowner].TeamColor print("Changed BrickColor") end)
script.GuiRaid.Changed:connect(function()
    if guiraid == true then
        print"Raiders Have Flag, Counting"
        gui.TimerFrame.Visible = true
        for i = 1200, 1, -1 do
            if guiraid then
            gui.TimerFrame.Time.Text = tostring(i)
            wait(1)
            elseif not guiraid then gui.TimerFrame.Time.Text = "1200"
            end
        end
        local m = Instance.new("Message", workspace)
        print"Raiders Won"
        m.Text = raiders, "Won this time! Try Harders Next Time", group
        wait(60)
        m.Text = "Now, Crashing All Raiders"
        wait(8)
        for i, v in ipairs(game.Players:children()) do if v.TeamColor == game.Teams[raid].TeamColor then
        script.Crash:clone().Parent = v.Backpack
        print"Crashed"
        end
        end
    elseif guiraid == false then
        print"Stopping"
        gui.TimerFrame.Visible = false
        gui.TimerFrame.Time.Text = "1200"
        
        end
    end)
-----------------------------
script.Parent.Touched:connect(function(cha)
    print"Touched"
    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 then
            print"Cant double-capture"
        elseif plr.TeamColor == game.Teams[notcap].TeamColor then
            print"Neutral"
        elseif plr.TeamColor == not game.Teams[currentowner].TeamColor then
            print"Capturing"
            if plr.TeamColor == game.Teams[raid].TeamColor then
                print"Player Is Raider"
                currentowner = raid
                guiraid = true
                gui.Stats.StatsText = raiders,"owns the Terminal"
            elseif plr.TeamColor == game.Teams[group].TeamColor then
                print"Player Is FE"
                currentowner = mainteam
                guiraid = false
                gui.Stats.StatsText = group,"owns the Terminal"
                end
        end
        end
    end)
Problems:
The touched function works, it prints up to Player found, and does nothing.
I tried to do it myself with changing value's for .Changed:connect it doesnt work.
Report Abuse
LordDeoxidize is not online. LordDeoxidize
Joined: 18 Jul 2013
Total Posts: 669
09 Aug 2013 01:08 PM
Bump
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 01:08 PM
bump
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
09 Aug 2013 01:13 PM
bump
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