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
 

Can anybody fix this script

Previous Thread :: Next Thread 
texastyaust is not online. texastyaust
Joined: 08 Feb 2009
Total Posts: 2735
27 Jan 2013 05:26 PM
This script for some reason makes it so even if you're the team with the flag, the flag still goes down a second time
local flag = script.Parent.Parent.Flag
local timemin = script.Parent.Parent.Minutes
local timesec = script.Parent.Parent.Seconds
local ct = script.Parent.Parent.FlagTeam --String Value
local ne = script.Parent.Parent.BottomBrick



ting = 0
function onTouch(hit)
if ting == 0 then
ting = 1
local hum = hit.Parent:findFirstChild("Humanoid")
if hum ~= nil then
local player = game.Players:GetPlayerFromCharacter(hum.Parent)
if player then
local teams = game.Teams:GetTeams()
for i=1, #teams do
if teams[i].TeamColor == player.TeamColor then
PT = teams[i]
t = teams[i]
if PT.Name == "Good Peoplez" then
PTC = "Bright blue"
elseif PT.Name == "Bad Peoplez" then
PTC = "Bright red"
else
print("not a team")
end
end
end
if PT ~= ct.Value then
for i=flag.CFrame.Y, ne.CFrame.Y, -.1 do
flag.Position = Vector3.new(flag.CFrame.X, i, flag.CFrame.Z)
wait(.01)
end
wait(1)
flag.BrickColor = BrickColor.new(PTC)
wait(1)
for i=ne.CFrame.Y, script.Parent.Parent.Head.CFrame.Y-5, .1 do
c t . V a l u e = P T . N a m e -- had to space to post for some reason
flag.Position = Vector3.new(flag.CFrame.X, i, flag.CFrame.Z)
wait(.01)
end
t.Score = t.Score+2
timemin.Value = 0
timesec.Value = 0
else
print("STOOPID")
end
ting = 0
else
end
else
end
else
end
end

script.Parent.Touched:connect(onTouch)


Report Abuse
texastyaust is not online. texastyaust
Joined: 08 Feb 2009
Total Posts: 2735
27 Jan 2013 05:31 PM
Bump
Report Abuse
texastyaust is not online. texastyaust
Joined: 08 Feb 2009
Total Posts: 2735
27 Jan 2013 05:38 PM
Nvm
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