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: how to get player who clicked from this

Previous Thread :: Next Thread 
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 08:48 PM
function Click()
print 'click'
end

script.Parent.MouseButton1Down:connect(Click)

Do you have to use that parent.parent.parent.parent.parent....
thing
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Aug 2013 08:49 PM
It depends, local script or not?
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 08:50 PM
not

as you can see
in a gui
textbutton
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Aug 2013 08:52 PM
So if it's a normal script, then you will have to do .Parent.Parent.Parent etc
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 08:53 PM
bump
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 08:53 PM
ok
how about localscript
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
23 Aug 2013 08:53 PM
game.Players.LocalPlayer for ANY LocalScript.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Aug 2013 08:53 PM
Game.Players.LocalPlayer
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
23 Aug 2013 08:55 PM
How do you like being superninja'd?
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 08:58 PM
really
so

function onClick()
local clicker = game.Players.LocalPlayer
clicker.Torso.CFrame = CFrame.new(Vector3.new(0, 50, 0))
end
script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
23 Aug 2013 08:58 PM
clicker.Character....
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 09:01 PM
explain further

clicker.Character.Torso.CFrame?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 09:02 PM
If you still want regular script, and it's located somewhere under the player:

local Player = Game.Players[script:GetFullName():match("Players%.(.-)%.")]
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 09:03 PM
CFrame.new(0, 50, 0)

No need for Vector3.new().

clicker.Character.Torso.CFrame = CFrame.new(0, 50, 0)
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 09:04 PM
but without the vector3.new() wouldn't it kill the character?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
23 Aug 2013 09:05 PM
No. CFraming the part does not break welds. Positioning does. Or you could use clicker.Character:MoveTo(Vector3.new(0, 50, 0))
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
23 Aug 2013 09:05 PM
To, setting the Torso does not break joints, as the joints Part0 is the Torso.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
23 Aug 2013 09:06 PM
@Cody: I am quite sure it only applies to parts whose Part0 is being moved, directly or indirectly.
Report Abuse
LuaKid18 is not online. LuaKid18
Joined: 01 Aug 2013
Total Posts: 678
23 Aug 2013 09:06 PM
you guys must have so much exp
thanks
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