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
 

I need help With a Fire Rate script

Previous Thread :: Next Thread 
schmidty1998 is not online. schmidty1998
Joined: 19 May 2010
Total Posts: 322
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 is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 11:43 AM
Is that the entire script? o.e
Report Abuse
SolarCrane is not online. SolarCrane
Forum Moderator
Joined: 03 Jul 2012
Total Posts: 116
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
schmidty1998 is not online. schmidty1998
Joined: 19 May 2010
Total Posts: 322
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
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