|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 08 Feb 2015 08:27 PM |
| It works okay in the studio? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2015 08:32 PM |
| It works perfectly in stuido |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|