|
| 04 Feb 2017 03:41 PM |
I put this script directly in to the tools I have, and my script isn't working in game, but will in studio mode.
local item = game.Workspace.Handcuffs -----your tool you want to put in to the player's backpack. function OnClick() local copy= item:Clone() copy.Parent= game.Players.LocalPlayer.Backpack end script.Parent.ClickDetector.MouseClick:connect(OnClick)
Techy |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 04 Feb 2017 03:46 PM |
The client can't do this, the server needs to, it will require you to use a RemoteEvent to ask the server to put the handcuffs in your backpack.
|
|
|
| Report Abuse |
|
|
|
| 04 Feb 2017 03:46 PM |
-_- I swear, I can't script4crap.
Techy |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2017 03:48 PM |
So, I'd put this stuff in ServerStorage..?
Techy |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Feb 2017 04:08 PM |
if your not using fe then no need for events:
if you want the item to be cloned then:
local item = game.Workspace.Handcuffs -----your tool you want to put in to the player's backpack. function OnClick() local copy= item:Clone() copy.Parent= game.Players.LocalPlayer.Backpack end item.ClickDetector.MouseClick:connect(OnClick)
Make sure there is a clickdetector inside the part |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2017 08:29 PM |
Well, I tried this script but it didn't work. :/.
Techy |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 04 Feb 2017 08:42 PM |
This should work:
local tool = game.ReplicatedStorage.Handcuffs script.Parent.ClickDetector.mouseClick:connect(function(playerWhoClicked) print('Clicked') local t2 = tool:Clone() t2.Parent = playerWhoClicked.Backpack end)
Put the tool you're using into ReplicatedStorage, then go to the first line and replace Handcuffs to the name of the tool you put in ReplicatedStorage
ATR'er since 2013. |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 04 Feb 2017 08:44 PM |
| Also, put the script in # ############ (Regular Script) then put that inside the part that you want clicked. ATR'er since 2013. |
|
|
| Report Abuse |
|
|