|
| 11 Jun 2017 07:07 PM |
I'm trying to make it throw a coconut, I got it, but I don't need it to be rapid fire! local speed = 100 local angle = 45
script.Parent.Equipped:Connect(function(m) m.Button1Down:Connect(function() local hrp = game.Players.LocalPlayer.Character.PrimaryPart local dir = (hrp.CFrame * CFrame.Angles(math.rad(angle), 0, 0)).lookVector local coconut = script.Parent.Handle:Clone() coconut.Parent = workspace coconut.Velocity = dir * speed end) end)
|
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 11 Jun 2017 07:09 PM |
local Equipped = false script.Parent.Equipped:Connect(function(m) Equipped = true end)
m.Button1Down:Connect(function() if Equipped then local hrp = game.Players.LocalPlayer.Character.PrimaryPart local dir = (hrp.CFrame * CFrame.Angles(math.rad(angle), 0, 0)).lookVector local coconut = script.Parent.Handle:Clone() coconut.Parent = workspace coconut.Velocity = dir * speed end end)
|
|
|
| Report Abuse |
|
|
| |
|
00doggie
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 337 |
|
|
| 11 Jun 2017 08:06 PM |
local speed = 100 local angle = 45 local debounce = true
script.Parent.Equipped:Connect(function(m) m.Button1Down:Connect(function() if debounce then debounce = false local hrp = game.Players.LocalPlayer.Character.PrimaryPart local dir = (hrp.CFrame * CFrame.Angles(math.rad(angle), 0, 0)).lookVector local coconut = script.Parent.Handle:Clone() coconut.Parent = workspace coconut.Velocity = dir * speed wait(1) debounce = true end end) end) |
|
|
| Report Abuse |
|
|
| |
|
00doggie
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 337 |
|
|
| 11 Jun 2017 08:24 PM |
| no problem, I like helping |
|
|
| Report Abuse |
|
|