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: easy script ffs help

Previous Thread :: Next Thread 
NiceCoder is not online. 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
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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 is not online. 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
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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 is not online. 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 is not online. 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 is not online. 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
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
08 Jul 2014 08:45 AM
Change the name back to "Tool".
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
08 Jul 2014 08:45 AM
i did and its broke
Report Abuse
NiceCoder is not online. 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 is not online. 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 is not online. YeahNick
Joined: 28 Feb 2009
Total Posts: 2536
08 Jul 2014 03:00 PM
wtf did u even try my version
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
08 Jul 2014 04:10 PM
ya and it has no debounce
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
09 Jul 2014 12:58 PM
huop
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
09 Jul 2014 02:24 PM
srs
Report Abuse
NiceCoder is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
09 Jul 2014 02:42 PM
STILL
NOT
FIXED
Report Abuse
smiley599 is not online. 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 is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
09 Jul 2014 03:37 PM
not working but hi smiley frend
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
09 Jul 2014 04:06 PM
It looks fine? Output?

and hi friend
Report Abuse
NiceCoder is not online. 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 is not online. NiceCoder
Joined: 15 Oct 2012
Total Posts: 6593
10 Jul 2014 07:33 AM
._.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
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 is not online. 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 is not online. 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
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
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
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