Queliux
|
  |
| Joined: 13 Feb 2011 |
| Total Posts: 341 |
|
|
| 03 May 2014 11:16 AM |
I've made a script which is supposed to kill a player when they click on a brick and then make a clone of the same player and move that to a certain position but it isn't working, what's the problem?
function onClick(plyr) plyr.Character:Clone().Parent = game.Workspace.Lol game.Workspace.Lol.CFrame = CFrame.new(Vector3.new(-144.199, 3.5, 161.201)) plyr.Character.Humanoid.Health = 0 end
script.Parent.ClickDetector.MouseClick:connect(onClick) |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 11:32 AM |
Well, what happens when you do it? Does a clone of the character enter the object Lol? Also, you can't set the CFrame of a Model. If the clone does enter Lol, do this:
function onClick(plyr) plyr.Character:Clone().Parent = game.Workspace.Lol game.Workspace.Lol:MoveTo(Vector3.new(-144.199, 3.5, 161.201)) plyr.Character.Humanoid.Health = 0 end
script.Parent.ClickDetector.MouseClick:connect(onClick)
Outfoxing Foxes |
|
|
| Report Abuse |
|
|
Queliux
|
  |
| Joined: 13 Feb 2011 |
| Total Posts: 341 |
|
|
| 03 May 2014 11:34 AM |
| Nothing happens whatsoever. |
|
|
| Report Abuse |
|
|
Queliux
|
  |
| Joined: 13 Feb 2011 |
| Total Posts: 341 |
|
|
| 03 May 2014 11:42 AM |
It says in the output:
17:41:35.005 - Workspace.Hmm.Script:6: attempt to index a nil value 17:41:35.006 - Stack Begin 17:41:35.007 - Script 'Workspace.Hmm.Script', Line 6 17:41:35.007 - Stack End 17:41:35.008 - Disconnected event because of exception
(Hmm is the name of the part which is meant to be clicked) |
|
|
| Report Abuse |
|
|