Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 11 Jul 2015 10:24 AM |
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() local p = game.Lighting["bean"]:Clone() p.Parent = game.Players.LocalPlayer.Backpack end)
i want it so when you click it it gives you a gear. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 10:33 AM |
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() local p = game.Lighting.bean:Clone() -- You Don't need "[]" p.Parent = plr.Backpack end)
-- Want to know how to script well you need too jflji1wre231;kjfdq
|
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
| |
|
|
| 11 Jul 2015 11:16 AM |
try this
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() game.Lighting["bean"]:Clone().Parent = game.Players.LocalPlayer.Backpack end) |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 11 Jul 2015 11:21 AM |
Okay stop right there guys. You're missing this.
local plr = game.Players.LocalPlayer function onButtonClicked() game.Lighting:FindFirstChild("bean"):Clone().Parent = plr.Backpack end script.Parent.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 11:22 AM |
woops wrong one XD
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() game.Lighting.bean:Clone().Parent = game.Players.LocalPlayer.Backpack end) |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
| |
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 11 Jul 2015 11:26 AM |
I advise you if you're making multiple buttons to use one script.
plr = game.Players.LocalPlayer console = script.Parent --the Screen Gui button = console.button -- The name of the specific text button. The class has to be text button.
function onButtonClicked()
game.Lighting:FindFirstChild("bean"):Clone().Parent = plr.Backpack end button.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 11 Jul 2015 11:27 AM |
| Also the way i told you to do this works unless you're doing something wrong. So figure it out. |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 11 Jul 2015 12:46 PM |
| It's a surface gui with a button and that doesn't work |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 12:47 PM |
| Make sure it is in PlayerGui, not Workspace. |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 11 Jul 2015 12:49 PM |
| It'S A SURFACE GUI NOT A GUI |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2015 01:03 PM |
I CAN USE CAPS TOO :D
Again, MAKE SURE it is in PlayerGui, NOT Workspace. LocalScripts DO NOT WORK in Workspace. LocalPlayer DOES NOT WORK in Scripts.
Put it in PlayerGui, and SET THE ADORNEE! |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 11 Jul 2015 01:05 PM |
| YOU CAN"T PUT IT IN PLAYERGUI IT'S A BRICK |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
| |
|