NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:21 AM |
script.Parent.Touched:connect(function onTouch(hit) if hit.Parent then a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end end)
its not working, meant to clone a tool from lighting into the player that touches the part's backpack |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:24 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent:IsA("Model") then a = game.Players:findFirstChild(hit.Parent.Name) local clone = game.Lighting["Tool"]:clone() clone.Parent = game.Players:findFirstChild(hit.Parent.Name).Backpack end end) |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:25 AM |
| works but lol i think i need debounce, it cloned like 10 of them |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:28 AM |
You probably know how to make debounce but here you go:
local debounce = false script.Parent.Touched:connect(function(hit) if debounce == true then debounce = true if hit.Parent:IsA("Model") then a = game.Players:findFirstChild(hit.Parent.Name) local clone = game.Lighting["Tool"]:clone() clone.Parent = game.Players:findFirstChild(hit.Parent.Name).Backpack end wait(1) debounce = false end end)
Also, in the future please try to avoid making duplicate posts or at least bury the previous threads. |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:32 AM |
ok and this fixed the debounce, just unsure if it will work when the player respawns or another player wants to take the tool but k
debounce=true script.Parent.Touched:connect(function(hit) if hit.Parent:IsA("Model") then a = game.Players:findFirstChild(hit.Parent.Name) local clone = game.Lighting["Tool"]:clone() clone.Parent = game.Players:findFirstChild(hit.Parent.Name).Backpack elseif game.Players.findFirstChild(hit.Parent.Name.Backpack.Tool) then return false end debounce=true end) |
|
|
| Report Abuse |
|
|
YeahNick
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2536 |
|
|
| 08 Jul 2014 08:36 AM |
ok i'm just rewriting your whole script
script.Parent.Touched:connect(function(h) if h.Parent:FindFirstChild("Humanoid") then local p = game.Players:FindFirstChild(h.Parent.Name) if p then local t = game.Lighting.Tool:Clone() t.Parent = p.BackPack end end end)
this should work try it out |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:42 AM |
| omg seriously its broke again because i renamed the tool to Infopad and put handles and stuff in the tool and i changed the name of it in the script too and its not working |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:45 AM |
| Change the name back to "Tool". |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:52 AM |
the debounce is broke omg this works but when i add the debounce it breaks
script.Parent.Touched:connect(function(hit) if hit.Parent:IsA("Model") then a = game.Players:findFirstChild(hit.Parent.Name) local clone = game.Lighting["Tool"]:clone() clone.Parent = game.Players:findFirstChild(hit.Parent.Name).Backpack end wait(1) end) |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:55 AM |
| omg this is starting to get on my nerve help |
|
|
| Report Abuse |
|
|
YeahNick
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2536 |
|
|
| 08 Jul 2014 03:00 PM |
| wtf did u even try my version |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 09 Jul 2014 02:51 PM |
script.Parent.Touched:connect(function(hit) a = game.Players:findFirstChild(hit.Parent.Name) if a then if not a.Backpack:findfirstChild("Tool") then local clone = game.Lighting["Tool"]:clone() clone.Parent = game.Players:findFirstChild(hit.Parent.Name).Backpack end end end) |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 09 Jul 2014 03:37 PM |
| not working but hi smiley frend |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 09 Jul 2014 04:06 PM |
It looks fine? Output?
and hi friend |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 10 Jul 2014 06:07 AM |
test it urself if u think its right this is exactly wat i hav
name of part is purrt script is inside it in lighting the tool is called tool
|
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
|
| 10 Jul 2014 07:39 AM |
Tool = game.Lighting.Tool:Clone() function AddTouch(Toucher) if Toucher.Parent game.Players:FindFirstChild(Toucher.Parent.Name) Player = game.Players:FindFirstChild(Toucher.Parent.Name) Tool.Parent = Player.Backpack end end script.Parent.Touched:connect(AddTouch) |
|
|
| Report Abuse |
|
|
YeahNick
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2536 |
|
|
| 10 Jul 2014 08:12 AM |
@above
That'll only work once put the :clone() part in the function |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 10 Jul 2014 08:42 AM |
anon's script works ok as long as the person throws the tool away and then goes back again for it and thats the point k thx anon but it could be kinda improved, glitches a lot |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2014 10:33 AM |
script.Parent.Touched:connect(function onTouch(hit) ypcall(function() if hit.Parent:IsA'Model' and not game:service'Players'[hit.Parent.Name].Backpack:FindFirstChild('Tool')then local tool=game:service'Lighting':WaitForChild'Tool':Clone() tool.Parent=game:service'Players'[hit.Parent.Name].Backpack end end) end) |
|
|
| Report Abuse |
|
|