|
| 12 Oct 2012 11:37 AM |
I'm trying to make a Fire Type script for Tirinity Republic's MPCR. However, I Keep getting this error:
06:29:17 - Workspace.Player1.MPCR-(30).Frate script:20: 'end' expected (to close 'if' at line 12) near 'else'
Here's the script:
auto=script.Parent.Config.Auto.Value shot=script.Parent.Config.shotgun.Value Burst=script.Parent.Config.burst.Value
function onEquipped(mouse2) mouse2.KeyDown:connect(onkeyDown) --one tab mouse = mouse2 --one tab end function onkeyDown(key) if key == "e" then --this is line 12 two tabs auto = false --all the shot, auto, and Burst are two tabs shot = true Burst = false else -- one tab auto = false shot = false Burst = true else -- line 20 one tab auto = true shot = false Burst = false end -- one tab end -- no tabs
script.Parent.Equipped:connect(onEquipped)
Can anybody help? |
|
|
| Report Abuse |
|
|
human
|
  |
| Joined: 06 May 2007 |
| Total Posts: 2765 |
|
|
| 12 Oct 2012 11:43 AM |
| Is that the entire script? o.e |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2012 01:00 PM |
| You have two elses for the same if statement, either make one an elseif or remove one of the elses from the script. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2012 02:01 PM |
Yeah. You see, it's all based off of values. If you've ever seen an RAT raycast (before boriolis came) the main gun script is based off of that. Instead of putting the values inside the script (as in, using damage = 16 inside of it, ect.), I put them in values in the tool, so instead of Damage = 16. It's damage = script.Parent.Config.damage.Value Whitch makes it more flexible. Make sense? |
|
|
| Report Abuse |
|
|