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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
|
| 24 Aug 2012 04:43 PM |
| My profile is older than yours. -.- |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 25 Aug 2012 12:51 PM |
| @Epic That will glitch out if a nonplayer touches it. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 29 Aug 2012 06:07 PM |
He's a STAFF MEMBER, therefore they have 'Special Rights' I suppose.
|
|
|
| Report Abuse |
|
|
|
| 29 Aug 2012 06:08 PM |
That rule never gets enforced...
¤¤ †KMXD† ¤¤ [SHG Tier~3] [Freelancing Scripting Guru] •д• |
|
|
| Report Abuse |
|
|
| |
|