|
|
|
TJ1357Join Date: 2008-05-22 Post Count: 299 |
Wait for either AgentFirefox or Crazypotato |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
object.Velocity = mouse.Origin.p.lookVector * speed
I fixed one problem. :3 |
|
|
MrNicNacJoin Date: 2008-08-29 Post Count: 28554 |
As long as the script doesn't error, this should work.
local bin = script.Parent
local f = Instance.new("ForceField")
local object = nil
local select = false
function onButton1Down(mouse)
if select == false then
if mouse.Target.Name == "GolfBall" then
if mouse.Target.Owner.Value == bin.Parent.Parent.Name then
mouse.Target.Owner.Value = bin.Parent.Parent.Name
object = mouse.Target
f.Parent = object
select = true
elseif select == true then
target = object
local character = bin.Parent.Parent.Character
speed = 50
object.Velocity = mouse.Hit.lookVector * speed
end
end
end
function onSelected(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
print("Selected")
script.Parent.Parent.Parent.PlayerGui.Cam.Frame.Visible = true
end
function onDeselect(mouse)
print("Diselected")
script.Parent.Parent.Parent.PlayerGui.Cam.Frame.Visible = false
select = false
f.Parent = nil
end
bin.Deselected:connect(onDeselect)
bin.Selected:connect(onSelected)
|
|
|
MrNicNacJoin Date: 2008-08-29 Post Count: 28554 |
Just telling me it doesn't work doesn't help. What happened? |
|
|
|
|
|
MrNicNacJoin Date: 2008-08-29 Post Count: 28554 |
Ah, just doing that with the mouse won't move the ball. You must allow the user to select two positions. One (the object) and two (the direction). |
|
|
|
|
|
|
|
|
|
|
|
|