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: Fix this morph script Please?

Previous Thread :: Next Thread 
awesomeguy19991 is not online. awesomeguy19991
Joined: 12 Aug 2010
Total Posts: 1067
19 Oct 2013 05:58 AM
So, I tried to combine a few morph scripts for a GUI and got this.

function onclick(click)
if click.Parent:findFirstChild("Humanoid") ~= nil and click.Parent:findFirstChild("LArm") == nil then
local suit = game.Lightning["LArm"]:clone()
suit.Parent = click.Parent
local G = suit:getChildren()
for i=1, #G do
if G[i].className == "Part" then
local suitW = Instance.new("Weld")
suitW.Part0 = suit.MainPart
suitW.Part1 = G[i]
local autoW = CFrame.new(suit.MainPart.Position)
suitW.C0 = suit.MainPart.CFrame:inverse()*autoW
suitW.C1 = G[i].CFrame:inverse()*autoW
suitW.Parent = suit.MainPart
end
local bpW = Instance.new("Weld")
bpW.Part0 = click.Parent["Left Arm"]
bpW.Part1 = suit.MainPart
bpW.C0 = CFrame.new(0, 0, 0)
bpW.Parent = suit.MainPart
end
local c = suit:getChildren()
for i=1, #c do
c[i].Anchored = false
c[i].CanCollide = false
end
end
end



script.Parent.MouseButton1Down:connect(onclick)


It's giving me a message, quote, " Players.Player1.PlayerGui.MorphGui.Frame.ButtonA.Script:2: attempt to index local 'click' (a number value)"

Please help D:

-Awesomeguy19991

BTW: To all spam: http://www.roblox.com/READ-place?id=113850396
Report Abuse
awesomeguy19991 is not online. awesomeguy19991
Joined: 12 Aug 2010
Total Posts: 1067
19 Oct 2013 06:12 AM
Please help me... :(

-Awesomeguy19991

BTW: To all spam: http://www.roblox.com/READ-place?id=113850396
Report Abuse
awesomeguy19991 is not online. awesomeguy19991
Joined: 12 Aug 2010
Total Posts: 1067
19 Oct 2013 08:12 AM
HELP!!
-Awesomeguy19991

BTW: To all spam: http://www.roblox.com/READ-place?id=113850396
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
19 Oct 2013 08:16 AM
The 'MouseButton1Down' event 'passes on' the X and Y of where the mouse clicked. If you wish to get to the player's character from the script you'll either need to parent to their player, and then get their character (Character property), or if it's in a LocalScript you can get their player (game.Players.LocalPlayer), followed by getting their character through the 'Character' property.
Report Abuse
awesomeguy19991 is not online. awesomeguy19991
Joined: 12 Aug 2010
Total Posts: 1067
19 Oct 2013 08:18 AM
Thx, I'll try it.
-Awesomeguy19991

BTW: To all spam: http://www.roblox.com/READ-place?id=113850396
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