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: Brick giving something

Previous Thread :: Next Thread 
Rage4EvA is not online. Rage4EvA
Joined: 29 Oct 2011
Total Posts: 145
24 Aug 2012 03:12 PM
I want to learn how to make a brick give you something when you touch it
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
24 Aug 2012 03:15 PM
A giver?

Make a brick, put into the onTouched event in the part and put in the event when someone touches it, it trigger and give u a tool, im sorry i dont write the script, im to lazy right now :/, but wiki may help (may not, it didnt help me, but try u lol)
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
24 Aug 2012 03:20 PM
Put the tool into the brick you want it to give....
Then there's some stuff in my script you need to edit. Look for -- notes.
(MAKE IT A LOCALSCRIPT!!!)



local debounce = true
function give(hit)
if debounce == true then
debounce = false
if hit.Parent:findFirstChild("Humanoid") ~= nil then
script.Parent["TOOL'SNAMEHERE"]:Clone().Parent = game.Players.LocalPlayer.Backpack -- Put your tool's name where it says "TOOL'SNAMEHERE".
wait(1.5)
debounce = true
end
end
end
script.Parent.Touched:connect(give)
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
24 Aug 2012 03:21 PM
1)Make sure my script is a LOCALSCRIPT.
2)Put the script into the brick.
3)And test it, then report feedback here.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
24 Aug 2012 03:23 PM
@zack, that giver script is so much more complicated then it should be..
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
24 Aug 2012 03:27 PM
WOW!!!!
Would you rather me use a GetPlayerFromCharacter() script?
That is one of the EASIEST giving scripts I have EVER seen!!
LOL you must not have seen a giver script.
-.-'
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
24 Aug 2012 03:48 PM
You must not have seen in the wiki or anything.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
24 Aug 2012 03:50 PM
Oh, Ok.. I really do have a big book filled with a beginner's tutorial to Robloxian Lua scripting for Dummiez.
P.S:
Quit trying to +1 me.
I haven't seen you write a script, you just know what the Touched event is. :)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
24 Aug 2012 04:05 PM
Ur obviously new ;)
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
24 Aug 2012 04:43 PM
My profile is older than yours. -.-
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
25 Aug 2012 04:26 AM
I bet u got someone other, or u pged.Besides i have alot of acc's this is one of them...
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
25 Aug 2012 04:34 AM
toolname = "" -- Add the tool name here
script.Parent.Touched:connect(function(prt)
if prt.Parent:FindFirstChild("Humanoid") then
if script.Parent:FindFirstChild(toolname) then
script.Parent:FindFirstChild(toolname):Clone().Parent = game.Players:FindFirstChild(prt.Parent.Name).Backpack
end
end
end)

Just put this into a brick and also put the tool in the brick.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
25 Aug 2012 04:35 AM
Eh, to disable multiples:

toolname = "" -- Add the tool name here
script.Parent.Touched:connect(function(prt)
if prt.Parent:FindFirstChild("Humanoid") then
if script.Parent:FindFirstChild(toolname) then
if not game.Players:FindFirstChild(prt.Parent.Name).Backpack:FindFirstChild(toolname) then
script.Parent:FindFirstChild(toolname):Clone().Parent = game.Players:FindFirstChild(prt.Parent.Name).Backpack
end
end
end
end)
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
25 Aug 2012 11:58 AM
@Fedorakid, you're violating the TOS of ROBLOX, you're not supposed to have multiple accounts/alts.
Most of you people don't READ WHAT YOU AGREE TO!
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
25 Aug 2012 12:05 PM
function onTouch(part)
local findParent = part.Parent
local clone = game.Lighting.Tool:Clone()
clone.Parent = findParent
end

game.Workspace.Giver.Touched:connect(onTouch)
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
25 Aug 2012 12:09 PM
Mines the easiest by far
Report Abuse
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
25 Aug 2012 12:51 PM
@Epic That will glitch out if a nonplayer touches it.
Report Abuse
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
25 Aug 2012 12:53 PM
@Zack Shedletsky has alts. Don't tell me he doesn't need to abide by the rules.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
29 Aug 2012 06:07 PM
He's a STAFF MEMBER, therefore they have 'Special Rights' I suppose.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
29 Aug 2012 06:08 PM
That rule never gets enforced...

¤¤ †KMXD† ¤¤ [SHG Tier~3] [Freelancing Scripting Guru] •д•
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
29 Aug 2012 06:09 PM
Ikr? :L
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