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
 

Re: Connection Line? attempt to index global 'mouse'

Previous Thread :: Next Thread 
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
02 Aug 2013 03:28 PM
--I don't want this in a tool, so it's in starterpack.

plyr = script.Parent.Parent.Parent
mouse = plyr:GetMouse()
function onKeyDown(key)
Key = key:lower()
if key == "z" then
RightShoulder = plyr.Character.Torso["Right Shoulder"]
LeftShoulder = plyr.Character.Torso["Left Shoulder"]
RightHip = plyr.Character.Torso["Right Hip"]
LeftHip = plyr.Character.Torso["Left Hip"]
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(1, 0, 0)
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(-1, 0, 0)
end
end
mouse.KeyDown:connect(onKeyDown)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Aug 2013 03:30 PM
Make it a local script
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
02 Aug 2013 03:32 PM
Um, that didn't change the output.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Aug 2013 03:33 PM
Then it should be .Parent.Parent, because:

-Player PARENT
--StarterGear PARENT
---Script

-.-
Or, in a local script (only way the getmouse will work):
Game.Players.LocalPlayer
Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
02 Aug 2013 03:36 PM
wait()
plyr = game.Players.LocalPlayer
while plyr == nil do wait() end
Character = plyr.Character
while character == nil do wait() end
wait()
mouse = plyr:GetMouse()

function onKeyDown(key)
Key = key:lower()
if key == "z" then
RightShoulder = Character.Torso["Right Shoulder"]
LeftShoulder = Character.Torso["Left Shoulder"]
RightHip = Character.Torso["Right Hip"]
LeftHip = Character.Torso["Left Hip"]
RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(1, 0, 0)
LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(-1, 0, 0)
end
end
mouse.KeyDown:connect(onKeyDown)

local script
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