|
| 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 |
|
|
|
| 19 Oct 2013 06:12 AM |
Please help me... :(
-Awesomeguy19991
BTW: To all spam: http://www.roblox.com/READ-place?id=113850396 |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 08:12 AM |
HELP!! -Awesomeguy19991
BTW: To all spam: http://www.roblox.com/READ-place?id=113850396 |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|