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: My new script has a bug

Previous Thread :: Next Thread 
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Sep 2013 11:12 AM
ok yah yah I making a SF map and u get a ff everywhere except on certain bricks where u fight. One problem. I can seem to get my scrip right. I need it to add only 1 ff and only if you don't have one yet. My script is a mess but here it is. Please help me:

local debounce=false --create a bool and set it to false
Game.Workspace.Part.Touched:connect(function(hit)
if debounce==false then debounce=true --check if the debounce is false and if it is set it to true

path.to.part.Touched:connect(function (hit)
if hit.Parent.FindFirstChild("Humanoid") ~= nil then
Instance.new("ForceField", hit.Parent)
end
end)

path.to.part.TouchEnded:connect(function (hit)
if hit.Parent.FindFirstChild("ForceField") ~= nil then
hit.Parent.ForceField:Destroy()
end
end)

wait(0.5) --you can change it to any number basically what this will do is make it to where the function can't fire until this time is up
debounce=false
end

Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
02 Sep 2013 11:14 AM
Add before Instancing;
if not hit.Parent:FindFirstChild("ForceField") then

Age of War Update Forum: [http://www.roblox.com/Forum/ShowPost.aspx?PostID=110942955]
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Sep 2013 11:39 AM
ok thanks for the tip, I just realized though that my script isn't giving you a forcefield...
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