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
 

Re: Iron Sight script

Previous Thread :: Next Thread 
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
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
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
05 Feb 2015 11:07 AM
whats the output
Report Abuse
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
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
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
05 Feb 2015 11:13 AM
ok smartass
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
05 Feb 2015 11:13 AM
@Champion

If you're going to be rude and not even help, Get out
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
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
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
05 Feb 2015 11:16 AM
rude* lol
Report Abuse
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
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 is not online. 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
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
05 Feb 2015 11:19 AM
Read the main article, I need some help!
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
05 Feb 2015 11:20 AM
What's the script output*
Report Abuse
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
05 Feb 2015 11:21 AM
MouseButton2Down is not a valid member of Tool
Report Abuse
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
05 Feb 2015 11:24 AM
'@badfitz u are an oter rite?'

yes

Mr. Chang wants some poodle with his noodles
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
05 Feb 2015 11:35 AM
I would, rather use my way, since it doesn't require him to change MouseButton2Down.
Report Abuse
Badfitz100 is not online. Badfitz100
Joined: 03 Nov 2010
Total Posts: 12591
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
05 Feb 2015 11:44 AM
You don't need a gui to check tools.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
05 Feb 2015 11:47 AM
http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton2Down
Report Abuse
digpoe is not online. 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
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