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: Anti-Team Kill Help for a gun that uses the 'Bullet' script.

Previous Thread :: Next Thread 
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 04:54 PM
I've tried many things, but no matter what, the anti-team kill script just makes the gun not kill ANYONE.
Can anyone help me?
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 04:55 PM
Post a script and I'll be glad to fix it for you!
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 04:56 PM
are there teams?
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 04:57 PM
Yes, there are teams.
In one line of the script, it says:
local GH = game.Players:findFirstChild(script.Parent.creator.Value.Name)
What does 'Value' mean?
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 04:58 PM
How did you make the script if you don't know what anything means in the script!!!
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:00 PM
"Value" means a Value.. -_-
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 05:00 PM
Rules: No free model fix requests
End of discussion
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:01 PM
:O U Y STEAL MY MOTTO!
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:02 PM
The script is one that I found, and mixed it with a gun that I rescripted.
The rescripted gun has Ammo/MaxAmmo/StoredAmmo, so I don't know if this has to do with anything with the Anti TK script.
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 05:02 PM
I took it
ad edited it
:)
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:03 PM
"Mixed it with a gun that I rescripted"
By rescripted I'm sure you mean "Changed it to say I made it"
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:06 PM
@grove
Wrong.
It was one of those really old guns that uses the 'Paintball' script.
I rescripted 2 of those.
One took no more than 15 minutes, while another took more than an hour, do to handle issues.
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 05:07 PM
By 'rescripted' you probably mean
you added
print 'I edited this!'
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:07 PM
Fair enough,
Still, post the scripts or we can't do anything to help

End of discussion
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:09 PM
Currently, what I have:

ball = script.Parent
damage = 30

function Check(hit)
local Humanoid = hit.Parent:findFirstChild("Humanoid")
if Humanoid then
local HisTorso = hit.Parent:findFirstChild("Torso")
if HisTorso then
if HisTorso.Color == script.Parent.Parent.Torso.Color then return false end
if HisTorso.Color ~= script.Parent.Parent.Torso.Color then return true end
end
end
end

function onTouched(hit)
Local MyTeam = Check(hit)
if not MyTeam then
hit.Parent.Humanoid:TakeDamage(damage)
end
end

function tagHumanoid(humanoid)
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
wait(8)
ball.Parent = nil

I tried 2 different things before so the gun would be anti-TK.
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:11 PM
There is absolutely nothing in that script about TeamColor...

End of discussion
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:14 PM
There is.
Where it says:
if HisTorso.Color == script.Parent.Parent.Torso.Color then return false end
It means that if the shooter tries to kill his teammate who has the same torso color, it does not do anything.
Therefor, it means you cannot kill your teammate.
However, I am having trouble making it work.
Report Abuse
FreeGamesROBLOX is not online. FreeGamesROBLOX
Joined: 15 Jun 2011
Total Posts: 6622
14 Feb 2012 05:15 PM
ball = script.parent
teehee
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:17 PM
ball = script.Parent
damage = 30
function Check(hit)
local Humanoid = hit.Parent:findFirstChild("Humanoid")
if Humanoid then
function onTouched(hit)
local checkteam = game.Players:FindFirstChild(hit.Parent.Name)
if checkteam.TeamColor == script.Parent.Parent.Parent.TeamColor then
end
elseif checkteam.TeamColor ~= script.Parent.Parent.Parent.TeamColor then
hit.Parent.Humanoid:TakeDamage(damage)
end
end
function tagHumanoid(humanoid)
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
wait(8)
ball.Parent = nil

End of discussion
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:17 PM
I have another Anti TK script, but it only kills you after you have killed your teammate.
Not really useful if you're trying to prevent team killing.
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
14 Feb 2012 05:17 PM
@Cool, how would checking the player's Torso color help decide their team.. :U

End of discussion
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 05:17 PM
@Grove
Thank you.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
14 Feb 2012 06:10 PM
@Grove
The script STILL does not work!
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