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 » Scripters
Home Search
 

Re: Click To Equip Isn't working.

Previous Thread :: Next Thread 
TheTechyButterfly is not online. TheTechyButterfly
Joined: 30 Jun 2013
Total Posts: 563
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 is not online. 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
TheTechyButterfly is not online. TheTechyButterfly
Joined: 30 Jun 2013
Total Posts: 563
04 Feb 2017 03:46 PM
-_- I swear, I can't script4crap.


Techy
Report Abuse
TheTechyButterfly is not online. TheTechyButterfly
Joined: 30 Jun 2013
Total Posts: 563
04 Feb 2017 03:48 PM
So, I'd put this stuff in ServerStorage..?


Techy
Report Abuse
TheTechyButterfly is not online. TheTechyButterfly
Joined: 30 Jun 2013
Total Posts: 563
04 Feb 2017 03:49 PM
.-.


Techy
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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
TheTechyButterfly is not online. TheTechyButterfly
Joined: 30 Jun 2013
Total Posts: 563
04 Feb 2017 08:29 PM
Well, I tried this script but it didn't work. :/.


Techy
Report Abuse
Eventive is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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