|
| 01 Aug 2015 06:18 PM |
Any ideas why this isn't working?
function ok() game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Vector3.new(0, 0, 0)) end script.Parent.MouseButton1Click:connect(ok) |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 01 Aug 2015 06:24 PM |
I'll give you a hint: "LocalPlayer" |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2015 06:25 PM |
| I know that, and i've placed it in a localscript, but it doesn't work then. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 01 Aug 2015 06:28 PM |
function ok() local plr = game.Players.LocalPlayer local char = plr.Character char:MoveTo(Vector3.new(0,0,0)) end script.Parent.MouseButton1Click:connect(ok)
if you are doing anything related to guis, i'll just say it's bad practice to use a server script for something like that. guis/userinput should be handled with a local script.
|
|
|
| Report Abuse |
|
|
|
| 01 Aug 2015 06:37 PM |
| Doesn't work. Plus, doesn't :MoveTo make a player walk there? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 01 Aug 2015 06:38 PM |
@killer where did you place the local script? and when you call :MoveTo() on a model, it moves the whole model to the vector3 you provided as an argument |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2015 06:40 PM |
@instawin
Workspace.Part.SurfaceGui.Frame.Textbutton |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 01 Aug 2015 06:55 PM |
local scripts don't run inside of parts, only as descendants of the client
http://wiki.roblox.com/index.php?title=API:Class/LocalScript
just put that surfacegui inside of startergui, and make sure you set the surface gui's adornee to the desired part, via local script
you layout should look like this
startergui --surfacegui ---yourframe ----yourbutton -----local script in button |
|
|
| Report Abuse |
|
|