|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|