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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to make a tool for a certain team?

Previous Thread :: Next Thread 
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 06:20 PM
So I was given this script:

function onTouch(hit)
local player = game.Players:FindFirstChild(hit.Parent.Name)
if player ~= nil then
game.Lighting.Revolver:Clone().Parent = player.Backpack
end
end

---

I basically want a tool for a certain team. So when a player touches the spawnlocation, it will change the team and give him the tool.

But I put the revolver in the Lighting folder like the script says. And the script is in the Spawnlocation. Still, nothing happens when I step on the spawnlocation and change team. Also, I even tried resetting my character.
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 06:23 PM
Again... People view the topic but don't help.
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 06:53 PM
This is BS. I've been waiting too long for this.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 06:54 PM
sometimes i dont get answers dude so dont rage at scripters
answer: just find the team color of the peeps
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 06:56 PM
Huh? "Find the team color of the peeps"?

Are you aware of this problem sir?
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:00 PM
yeah, do a function
player.TeamColor.Changed:connect(function()
if player.TeamColor == teamcolor here then
give tools
end)
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:00 PM
oh wait i see what ur doing
give me a minute
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:02 PM
function onTouch(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
if player.Backpack ~= nil then
game.Lighting.Revolver:Clone().Parent = player.Backpack
end
end
end --Helped by Drybones3363

script.Parent.Touched:connect(onTouch) --forgot to execute the function
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 07:05 PM
So it will look like this sir?

function onTouch(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
if player.Backpack ~= nil then
game.Lighting.Revolver:Clone().Parent = player.Backpack
end
end
end
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:06 PM
with this on the bottom to execute the function:
script.Parent.Touched:connect(onTouch)
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 07:14 PM
Thank you!
It works, but..

I get like 20 Revolvers... Lol.
And it adds more everytime I step on it.
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:16 PM
debounce = false

function onTouch(hit)
if debounce == false then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
if player.Backpack ~= nil then
game.Lighting.Revolver:Clone().Parent = player.Backpack
end
end
wait(2)
debounce = false
end --Helped by Drybones3363

script.Parent.Touched:connect(onTouch) --forgot to execute the function
Report Abuse
ComplexitySimplicity is not online. ComplexitySimplicity
Joined: 04 Jun 2014
Total Posts: 40
09 Jun 2014 07:21 PM
Ever wonder why you don't get an answer. We scripters don't live solely to fix scripts you found. Don't be crabby with us. Acting like that will not get you an answer.
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 07:24 PM
Drybones, now it won't work at all. Lol :P
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
09 Jun 2014 07:30 PM
debounce = false

function onTouch(hit)
if debounce == false then
debounce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
if player.Backpack ~= nil then
game.Lighting.Revolver:Clone().Parent = player.Backpack
end
end
wait(2)
debounce = false
end
end --Helped by Drybones3363

script.Parent.Touched:connect(onTouch) --forgot to execute the function
Report Abuse
ComplexitySimplicity is not online. ComplexitySimplicity
Joined: 04 Jun 2014
Total Posts: 40
09 Jun 2014 07:31 PM
I hate seeing stuff like that.

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
local player = game.Players:findFirstChild(hit.Parent.Name)
if not player.Backpack:findFirstChild("Revolver") then
game.Lighting.Revolver:Clone().Parent = player.Backpack
elseif player.Backpack:findFirstChild("Revolver") then
end end end)

Not sure about the end count.
Report Abuse
ComplexitySimplicity is not online. ComplexitySimplicity
Joined: 04 Jun 2014
Total Posts: 40
09 Jun 2014 07:35 PM
Drybones script isnt as good. If something thats not a player touches it, it has a chance of breaking. Both scripts will work.
Report Abuse
ComplexitySimplicity is not online. ComplexitySimplicity
Joined: 04 Jun 2014
Total Posts: 40
09 Jun 2014 07:36 PM
Nevermind, it still would work. Im making to many mistakes tonight.
Report Abuse
fishy1000 is not online. fishy1000
Joined: 26 May 2008
Total Posts: 497
09 Jun 2014 07:41 PM
Still adds more.
If you stay on it, it will add like 1 every 2-3 seconds.
Report Abuse
ComplexitySimplicity is not online. ComplexitySimplicity
Joined: 04 Jun 2014
Total Posts: 40
09 Jun 2014 07:42 PM
Use mine. Mine wont do that.
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