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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Jun 2014 07:00 PM |
oh wait i see what ur doing give me a minute |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 09 Jun 2014 07:06 PM |
with this on the bottom to execute the function: script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Jun 2014 07:36 PM |
| Nevermind, it still would work. Im making to many mistakes tonight. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 09 Jun 2014 07:42 PM |
| Use mine. Mine wont do that. |
|
|
| Report Abuse |
|
|