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: Flag Troubles

Previous Thread :: Next Thread 
Benythebull is not online. Benythebull
Joined: 29 Jul 2011
Total Posts: 390
15 Dec 2013 06:35 PM
Can you please help me here? I am wondering if name or name two is the defending team. Can you please tell me where to fill it in with Defender and Attacker? Thank you. (Things in brackets are questions.)
bin = script.Parent.Base
owner = script.Parent.CurrentOwner
distance = script.Parent.CaptureDistance.Value
steps = script.Parent.StepsToBottom
maxsteps = steps.Value
a = script.Parent.Flag
b = script.Parent.FlagDetail
neutral = script.Parent.NeutralColor.Value

attackingteam = nil (What do I do here?)
defendingteam = nil (What do I do here?)

script.Parent.FlagManager.Disabled = false

players = {}

for i,v in pairs(game.Players:GetPlayers()) do
table.insert(players, v)
end

game.Players.PlayerAdded:connect(function(p) table.insert(players, p) end)

function findTeamByColor(color) (What does findteambycolor mean?)
returnee = "" (What goes here?)
for i,v in pairs(game.Teams:children()) do
if v.TeamColor == color then
returnee = v.Name
break
end
end
return returnee
end

function moveFlag(team, name, name2) (Do I have to replace team, name, name2?)
if (team ~= owner.Value) and (owner.Value ~= neutral) then
if steps.Value > 0 then
a.CFrame = a.CFrame-Vector3.new(0,14/maxsteps,0)
b.CFrame = b.CFrame-Vector3.new(0,14/maxsteps,0)
steps.Value = steps.Value-1
if steps.Value == 0 then
attackingteam = team
defendingteam = owner.Value
owner.Value = neutral
if m~=nil then m:Remove() end
m = Instance.new("Hint", workspace)
m.Text = "The flag " ..script.Parent.Name.. ", owned by " ..name2.. ", is being captured by the " ..name.. "!"
game:service("Debris"):AddItem(m, 5)
end
end
elseif (team == owner.Value) and (owner.Value ~= neutral) then
if steps.Value < maxsteps then
a.CFrame = a.CFrame+Vector3.new(0,14/maxsteps,0)
b.CFrame = b.CFrame+Vector3.new(0,14/maxsteps,0)
steps.Value = steps.Value+1
if steps.Value == maxsteps then
owner.Value = team
end
end
elseif (team ~= owner.Value) and (owner.Value == neutral) then
if team == defendingteam then (What do I do here?)
if steps.Value > 0 then
a.CFrame = a.CFrame-Vector3.new(0,14/maxsteps,0)
b.CFrame = b.CFrame-Vector3.new(0,14/maxsteps,0)
steps.Value = steps.Value-1
if steps.Value == 0 then
if m~=nil then m:Remove() end
m = Instance.new("Hint", workspace)
m.Text = "The flag " ..script.Parent.Name.. " has been recovered from the " ..findTeamByColor(attackingteam) (What do I do?).. " by the " ..name.. "!"
game:service("Debris"):AddItem(m, 5)
attackingteam = nil
defendingteam = nil
owner.Value = team
end
end
else
a.CFrame = a.CFrame+Vector3.new(0,14/maxsteps,0)
b.CFrame = b.CFrame+Vector3.new(0,14/maxsteps,0)
steps.Value = steps.Value+1
if steps.Value == maxsteps then
if m~=nil then m:Remove() end
m = Instance.new("Hint", workspace)
if defendingteam then
m.Text = "The flag " ..script.Parent.Name.. " has been captured by the " ..name.. " from the " ..findTeamByColor(defendingteam) (What do I do?).. "!"
else
m.Text = "The flag " ..script.Parent.Name.. " has been claimed by the " ..name.. "."
end
game:service("Debris"):AddItem(m, 5)
attackingteam = nil (What does nil mean?)
defendingteam = nil (What does nil mean?)
owner.Value = team
end
end
end
end

while true do
wait()
for i,v in pairs(players) do
if v.Character ~= nil then
torso = v.Character:findFirstChild("Torso")
if torso ~= nil then
if (torso.Position-bin.Position).magnitude <= distance then
if v.TeamColor ~= neutral then
moveFlag(v.TeamColor, findTeamByColor(v.TeamColor), findTeamByColor(owner.Value)) (What do I do in the sentence above?)
end
end
end
end
end
end
Report Abuse
Angelodude99 is not online. Angelodude99
Joined: 17 Feb 2012
Total Posts: 3543
15 Dec 2013 06:38 PM
wat

~[American]~
Report Abuse
Benythebull is not online. Benythebull
Joined: 29 Jul 2011
Total Posts: 390
15 Dec 2013 06:58 PM
Bump.
Report Abuse
GiganticNate112233 is not online. GiganticNate112233
Joined: 18 Jan 2012
Total Posts: 532
15 Dec 2013 07:04 PM
u,u,u,u, u better chek urself before u rekt urself coz im bad fur ur health i come reall stealth, droppin bombs on ur mums, screw car alarmz
Report Abuse
TAC69 is not online. TAC69
Joined: 16 May 2013
Total Posts: 195
15 Dec 2013 07:43 PM
When you do end for the last time, do this
Example:
end
end
end)
Report Abuse
Credens is not online. Credens
Joined: 17 Jun 2013
Total Posts: 374
15 Dec 2013 07:44 PM
ok.















































































use a fm
Report Abuse
Benythebull is not online. Benythebull
Joined: 29 Jul 2011
Total Posts: 390
15 Dec 2013 07:44 PM
That is a lot of help. :/ Please help with whole script.
Report Abuse
xXSheldonCooperXx is not online. xXSheldonCooperXx
Joined: 28 Feb 2013
Total Posts: 170
15 Dec 2013 09:47 PM
u,u,u,u, u better chek urself before u rekt urself coz im bad fur ur health i come reall stealth, droppin bombs on ur mums, screw car alarmz
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
15 Dec 2013 09:48 PM
Dont just post a random script and post some stuff you know nothing about.
Report Abuse
insaneROBLOXER123 is not online. insaneROBLOXER123
Joined: 23 Nov 2011
Total Posts: 192
15 Dec 2013 10:37 PM
tl;dr

-IПƧΛПΣ--------------------------------------นิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิ
Report Abuse
awesomeme100 is not online. awesomeme100
Joined: 14 Dec 2009
Total Posts: 781
16 Dec 2013 03:36 PM
hmmm...did you try turning it to wumbo?
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