|
| 20 Jun 2011 09:04 AM |
| I want to add one to my game that isn't a free model, and I need to know how to make it! |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 20 Jun 2011 09:05 AM |
| There should be a flag on a flag stand in the Insert panel. |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Jun 2011 09:08 AM |
| Yes, i know there is a stand but the one in his games go up and down and you do not have to pick it it you just stand next to it! |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 09:11 AM |
| What I mean is, I want a flag that you stand close to and then it goes up and down until you capture it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Jun 2011 09:15 AM |
| I don't know how to script... |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Jun 2011 09:30 AM |
| Ok, that was pretty lol. BUT I REALLY NEED HELP!!! |
|
|
| Report Abuse |
|
|
Wfs225
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 65 |
|
|
| 20 Jun 2011 09:36 AM |
| This is not a request forum so sorry. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 09:37 AM |
| No! I am asking how to make one! ... |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 09:38 AM |
| God, posting forums for help and keeping them on track is extremely hard work! |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 09:59 AM |
| Well, if you don't know HOW to script, you're not gonna understand HOW to make it. |
|
|
| Report Abuse |
|
|
1Ra
|
  |
| Joined: 02 May 2010 |
| Total Posts: 2400 |
|
| |
|
|
| 20 Jun 2011 10:48 AM |
| onTouched won't work, you gotta use magnitude. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 10:49 AM |
| on touch will work if you make an invisible and can collide false brick around the flag ;P |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 10:51 AM |
| It's too complicated though. You'd have to have multiple bricks and multiple checks on them. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2011 10:53 AM |
| I wasn't saying it's the best I was just saying magnitude isn't the only way |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 Jul 2011 07:26 PM |
| I've come up with code similar to what I believe you want. Let me... retrieve it.. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:27 PM |
.Touched
Not onTouch. onTouch is merely the name of the function that people chose to use. The real event is .Touched.
Magnitude is your answer.
if (plyr.Torso.Position - flag.Position).magnitude <= 10 then |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:33 PM |
This is a bugged version of my flag capture script. I don't remember how I fixed it...
local OwnerTeam = script.Parent.OwnerTeam local Flag = script.Parent.Flag.Fabric local time4one = 4 local offset = 0 local red = BrickColor.new("Bright red") local blue = BrickColor.new("Bright blue") local default = BrickColor.new("Medium stone grey")
function getTeams() --reds, blues local reds = { } local blues = { } for _, v in pairs(game.Players:GetPlayers()) do if v.TeamColor == red then table.insert(reds, v) else table.insert(blues, v) end end return reds, blues end
function getNumRedsBluesInArea() local reds, blues = getTeams() local redC, blueC = 0, 0; for _, v in pairs(reds) do if v.Character and v.Character:FindFirstChild("Torso") then if (v.Character.Torso.Position.x^2 + v.Character.Torso.Position.z^2)^0.5 <= script.Parent.Region.Size.x/2 then redC = redC + 1 end end end for _, v in pairs(blues) do if v.Character and v.Character:FindFirstChild("Torso") then if (v.Character.Torso.Position.x^2 + v.Character.Torso.Position.z^2)^0.5 <= script.Parent.Region.Size.x/2 then blueC = blueC + 1 end end end return redC, blueC end
function getPeople() --ALWAYS ally, enemy if OwnerTeam.Value == default then return getTeams() end local enemies = { } local allies = { } for _, v in pairs(game.Players:GetPlayers()) do if v.TeamColor ~= OwnerTeam.Value then table.insert(enemies, v) else table.insert(allies, v) end end return allies, enemies end
function ResetFlag() Flag.Mesh.Offset = Vector3.new(0,0,0) end
function Capture(team) local reds, blues = getTeams() if team == red then for _, v in pairs(reds) do if v.Character and v.Character:FindFirstChild("Torso") then if (v.Character.Torso.Position.x^2 + v.Character.Torso.Position.z^2)^0.5 <= script.Parent.Region.Size.x/2 then v.leaderstats.Points.Value = v.leaderstats.Points.Value + 50 end end end else for _, v in pairs(blues) do if v.Character and v.Character:FindFirstChild("Torso") then if (v.Character.Torso.Position.x^2 + v.Character.Torso.Position.z^2)^0.5 <= script.Parent.Region.Size.x/2 then v.leaderstats.Points.Value = v.leaderstats.Points.Value + 50 end end end end for _, v in pairs(script.Parent:GetChildren()) do if v:IsA("SpawnLocation") then v.TeamColor = team end end OwnerTeam.Value = team Flag.BrickColor = team ResetFlag() end
function Recolor(team) Flag.BrickColor = team end
function GetFirstInArea() while true do for _, v in pairs(game.Players:GetPlayers()) do if v.Character and v.Character:FindFirstChild("Torso") then if (v.Character.Torso.Position.x^2 + v.Character.Torso.Position.z^2)^0.5 <= script.Parent.Region.Size.x/2 then return v end end end wait() end end
function Animate() local Noob = GetFirstInArea() while offset > -10 do local R, B = getNumRedsBluesInArea() if Noob.TeamColor == red and R == 0 then ResetFlag() return end if Noob.TeamColor == blue and B == 0 then ResetFlag() return end if R==0 and B==0 then ResetFlag() return end if (R==0 and B~=0) or (R~=0 and B==0) then offset = offset - (1/time4one * (Noob.TeamColor == red and R or B)) Flag.Mesh.Offset = Vector3.new(0,offset,0) end wait(0.05) end Recolor(Noob.TeamColor) while offset < 0 do local R, B = getNumRedsBluesInArea() if Noob.TeamColor == red and R == 0 then ResetFlag() return end if Noob.TeamColor == blue and B == 0 then ResetFlag() return end if R==0 and B==0 then ResetFlag() return end if (R==0 and B~=0) or (R~=0 and B==0) then offset = offset + (1/time4one * (Noob.TeamColor == red and R or B)) Flag.Mesh.Offset = Vector3.new(0,offset,0) end wait(0.05) end Capture(Noob.TeamColor) end
Recolor(OwnerTeam.Value) while wait() do Animate() end
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:38 PM |
T.T
print(Roblox.People.RBXSummerDay:GetMainAccount()) |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 07:41 PM |
| > "The data is not Archived." |
|
|
| Report Abuse |
|
|