|
| 05 Feb 2015 11:05 AM |
function onClicked() local target = script.Parent.Camera local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 while wait() do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part angle = angle + math.rad(1) end end
script.Parent.MouseButton2Down:connect(onClicked)
It doesn't work, please help me to make it work please, and don't forget to make the camera back to the player when the button been pressed again. You will have a award when you make it work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Feb 2015 11:12 AM |
The output is useful to view errors and also the words printed using this command:
print("Something") |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Feb 2015 11:13 AM |
@Champion
If you're going to be rude and not even help, Get out |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:15 AM |
| How am I being round. I asked what the output was, and he replied with a smartass reply. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Feb 2015 11:17 AM |
'If you're going to be rude and not even help, Get out'
you get out, he was being nice and gave a helpful reply and this child replies with some smart ass response
Mr. Chang wants some poodle with his noodles |
|
|
| Report Abuse |
|
|
momim10
|
  |
| Joined: 21 Dec 2014 |
| Total Posts: 7257 |
|
|
| 05 Feb 2015 11:19 AM |
@badfitz u are an oter rite?
hello mom! i'm 10/obey/ipLSKD/Vege/tons of more accounts k |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:19 AM |
| Read the main article, I need some help! |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Feb 2015 11:21 AM |
| MouseButton2Down is not a valid member of Tool |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:24 AM |
'@badfitz u are an oter rite?'
yes
Mr. Chang wants some poodle with his noodles |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:26 AM |
I don't think MouseButton2Down is for tools; it's rather for GUIs. I would suggest doing this: Create a Gui Button. Make it fill the entire screen. Make it invisible. Whenever the person clicks the right mouse button, check if the tool is equipped. If it is, do what you want it to do. If not, then end. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:34 AM |
'MouseButton2Down is not a valid member of Tool'
Try making it a different button like Q
local mouse = game.Players.LocalPlayer local aiming = false local camera = workspace.CurrentCamera mouse.KeyDown:connect(function(key) if key == q and not aiming then aiming = true local target = script.Parent.Camera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 while wait() do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part angle = angle + math.rad(1) end elseif key == q and aiming then aiming = false camera.CameraType = Enum.CameraType.Custom camera.CameraSub = plr.Character.Humanoid end end)
Mr. Chang wants some poodle with his noodles |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:35 AM |
| I would, rather use my way, since it doesn't require him to change MouseButton2Down. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:37 AM |
'I would, rather use my way, since it doesn't require him to change MouseButton2Down.'
no offence but your way seems kind of stupid, you can keep it simple with keydown
i think keydown has a hex code for mouse buttons as-well.
Mr. Chang wants some poodle with his noodles |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:41 AM |
| How is it stupid? I'm pretty sure it's how loleris did it. Like, c'mon. There is nothing "stupid" about it. It doesn't get in the way. He can carry on using Right Click. Most people prefer using that rather than Q. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:44 AM |
| You don't need a gui to check tools. |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2015 11:47 AM |
| http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton2Down |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 05 Feb 2015 11:56 AM |
tool.Equipped:connect(function(mouse) mouse.Button2Down:connect(function() print("OMG MOUSE 2 DOWN!!11") end) end) |
|
|
| Report Abuse |
|
|