jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:04 PM |
I'm building a Pickaxe tool, it is longer but I am only going to post the issues.
Lines 6-17
function cursor(mouse) print("Tool activated!") mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = false mouse.Button1Down:connect(function() if enabled == true then print("This tool is being used") return end if enabled == false then print("This tool is NOT being used") enabled = true
Line 48 is just an end
Line 48
end)
And this is the OutPut: Workspace.Pickaxe Model 5.Mine:48: ')' expected (to close '(' at line 10) near 'end'
they just want me to close that functoin... And I'm pretty sure I am!!! Anyone know what is wrong? |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:06 PM |
| bump, I have to go soon so if I could get an answer tonight that would be just fantastic. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:08 PM |
| Put another end) on line 14 or 16 ? |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:10 PM |
| Another could you explain why? And I will try it. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:11 PM |
| the first end is supposed to have a ) on it. Just like I gave you. |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:13 PM |
Heres the full script, as you can see I have multiple ends...
pick = script.Parent function losecursor(mouse) mouse.Icon = "rbxasset://textures\\ArrowCursor.png" end function cursor(mouse) print("Tool activated!") mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = false mouse.Button1Down:connect(function() if enabled == true then print("This tool is being used") return end if enabled == false then print("This tool is NOT being used") end enabled = true print(mouse.Target.Name) if mouse.Target.Name == "Copper" then if enabled == true then return end mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" for i=1, 3 do pick.GripForward = Vector3.new(1, -0.25, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0, 0) wait(0.07) pick.GripForward = Vector3.new(1, 1, 0) wait(0.07) pick.GripForward = Vector3.new(1, 2.5, 0) wait(0.07) pick.GripForward = Vector3.new(1, 5, 0) wait(0.07) pick.GripForward = Vector3.new(1, 2, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0.75, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0, 0) wait(1) end mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = false end end end end) script.Parent.Equipped:connect(cursor) script.Parent.Unequipped:connect(losecursor) |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:15 PM |
| Well, in 2.0 there is arrows that pull up the 'end)' or 'end' (s) allong with the function needed. Every arrow should have ATLEAST 1 end or end) depending on the situation. Yours will get a 'end)' not end. Any end that is not pulled up is not needed. That is how I check. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:18 PM |
| Or if you wanted to do that independatly... For every '(function()' you need a 'end)' after the end of the function. Understand? Btw don't ad the ' s |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:20 PM |
I know that stuff... Well its still mad at me for some end, I changed a little bit, this is what I have now: btw still dosn't work
pick = script.Parent function losecursor(mouse) mouse.Icon = "rbxasset://textures\\ArrowCursor.png" end function cursor(mouse) print("Tool activated!") mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = false mouse.Button1Down:connect(function() if enabled == true then print("This tool is being used") return end if enabled == false then print("This tool is NOT being used") enabled = true print(mouse.Target.Name) if mouse.Target.Name == "Copper" then mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" for i=1, 3 do pick.GripForward = Vector3.new(1, -0.25, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0, 0) wait(0.07) pick.GripForward = Vector3.new(1, 1, 0) wait(0.07) pick.GripForward = Vector3.new(1, 2.5, 0) wait(0.07) pick.GripForward = Vector3.new(1, 5, 0) wait(0.07) pick.GripForward = Vector3.new(1, 2, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0.75, 0) wait(0.07) pick.GripForward = Vector3.new(1, 0, 0) wait(1) end mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = false end end end end) end script.Parent.Equipped:connect(cursor) script.Parent.Unequipped:connect(losecursor) |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:22 PM |
If there is a keyword without a '(' Infront of it it will get an end.
Ex. if (msg == "Hello World!") then print("hello world") end |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 26 Sep 2012 10:25 PM |
| Eh thanks for trying to help guys, I will continue this in the morning. Bye! |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2012 10:27 PM |
Problem: Line 13 Expected ')' to close that function.. Dude get rid out that 'end' and you need a 'end)' ON THAT LINE. No where else. |
|
|
| Report Abuse |
|
|