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: Script Help

Previous Thread :: Next Thread 
Queliux is not online. 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
idyllically is not online. idyllically
Joined: 13 Mar 2010
Total Posts: 4622
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 is not online. Queliux
Joined: 13 Feb 2011
Total Posts: 341
03 May 2014 11:34 AM
Nothing happens whatsoever.
Report Abuse
Queliux is not online. 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
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