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
 

When they drop a tool I dont want them to pick it up

Previous Thread :: Next Thread 
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 07:50 PM
My friend wanted me to make a basket ball & hoop so I said sure and Im having trouble with the release of the ball, when I do, you just get it back right away. How do I add a short debounce so you cant pick it up?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 08:04 PM
:/
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 08:05 PM
This be my script



local player=game.Players.LocalPlayer
local tool=script.Parent
local handle=tool:WaitForChild('Handle')
local mouse=player:GetMouse()
tool.Equipped:connect(function()
mouse.Button1Down:connect(function()
local targ=mouse.Target
local hanpos=handle.Position
tool.Parent=workspace
handle.CFrame=CFrame.new(hanpos)*CFrame.new(1,1,2)
wait()
handle.Velocity=((mouse.Hit.p)-handle.Position).Unit*100
end)
handle.Touched:connect(function(h)
if h.Parent:FindFirstChild('Humanoid') then
tool.Parent=h.Parent
handle.Velocity=Vector3.new(0,0,0)
end
end)
end)
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 08:13 PM
Okay I did this script, and it works great, unless your in play mode in which it sends you forward and you dont drop it and stuff


local tool=script.Parent
tool.Equipped:connect(function(mouse)
local player=game.Players.LocalPlayer
local handle=tool:WaitForChild('Handle')
local torso=player.Character.Torso
mouse.Button1Down:connect(function()
local targ=mouse.Target
local hanpos=handle.Position
tool.Parent=workspace
handle.CFrame=CFrame.new(torso.Position+Vector3.new(0,3,0))*CFrame.new((mouse.Hit.p-player.Character.Torso.Position).Unit*5)
handle.Velocity=((mouse.Hit.p)-handle.Position).Unit*75
end)
end)
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
08 Feb 2015 08:27 PM
It works okay in the studio?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 08:32 PM
It works perfectly in stuido
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
08 Feb 2015 08:35 PM
Hmm. Try looking at the dev console in playmode to check for errors/output.
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
08 Feb 2015 08:37 PM
No output, you can see for yourself at my game B-Ball.

Also I tried making it a server script but that didn't work at all

--This is the code that was in the server script, my current code is the same
script.Parent.Equipped:connect(function(mouse)
local player=game.Players:GetPlayerFromCharacter(script.Parent.Parent)
local tool=script.Parent
local handle=tool:WaitForChild('Handle')
local torso=player.Character.Torso
mouse.Button1Down:connect(function()
local targ=mouse.Target
local hanpos=handle.Position
tool.Parent=workspace
handle.CFrame=CFrame.new(torso.Position+Vector3.new(0,3,0))*CFrame.new((mouse.Hit.p-player.Character.Torso.Position).Unit*5)
handle.Velocity=((mouse.Hit.p)-handle.Position).Unit*75
end)
end)
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
08 Feb 2015 08:39 PM
Alright well if no one else has posted I'll take a look tomorrow perhaps. I'm heading off for now, sorry.
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