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 » Scripting Helpers
Home Search
 

My first attempt at making a tool

Previous Thread :: Next Thread 
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
28 Oct 2012 04:10 PM
player = script.Parent.Parent.Character

function clicked()

c = player.Torso:findFirstChild("Right Shoulder")
c.DesiredAngle = 0.5
end
script.Parent.MouseButton1Down:connect(clicked)
------------------------

T_T no worky. I'm checking output right now.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
28 Oct 2012 04:13 PM
Updated code:

player = script.Parent.Parent

function clicked()

c = player.Torso:findFirstChild("Right Shoulder")
c.DesiredAngle = 0.5
end
script.Parent.MouseButton1Down:connect(clicked)


I don't know the clicked function for tools
Report Abuse
Blankscarface23 is not online. Blankscarface23
Joined: 12 Apr 2011
Total Posts: 1234
28 Oct 2012 10:23 PM
What you did wrong was you did not call the selected function then connect the click function like this.

function clicked(mouse)

c = game.Players.LocalPlayer.Character.Torso:FindFirstChild("Right Shoulder")
if c then
c.DesiredAngle = 0.5
end
function finish(mouse)
mouse.Button1Down:connect(function()clicked(mouse) end)
end

script.Parent.Selected:connect(finish)

I hope that this helped :)
--Blankscarface23
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
28 Oct 2012 11:31 PM
Cleaning up blansarface's script

(in a local script)

script.Parent.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()
pcall(function()
game.Players.LocalPlayer.Character.Torso["Right Shoulder"].DesiredAngle = 0.5
end)
end)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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