Jro1311
|
  |
| Joined: 01 Jun 2013 |
| Total Posts: 3328 |
|
|
| 14 Aug 2013 07:30 PM |
So, I'm not really a good script. So how would you make this a one time use FF giver script?
local debounce = false function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil and debounce == false then debounce = true Field = Instance.new("ForceField") Field.Parent = part.Parent wait(0.1) debounce = false end end
if (script.Parent ~= nil) and (script.Parent.className == "Part") then connection = script.Parent.Touched:connect(onTouched) end
*facepalm*facedesk*facewall*facefloor*facepop*facetree*facesand*facecake* |
|
|
| Report Abuse |
|
|
Jro1311
|
  |
| Joined: 01 Jun 2013 |
| Total Posts: 3328 |
|
|
| 14 Aug 2013 07:32 PM |
Lol I mean scripter not script.
*facepalm*facedesk*facewall*facefloor*facepop*facetree*facesand*facecake* |
|
|
| Report Abuse |
|
|
Jro1311
|
  |
| Joined: 01 Jun 2013 |
| Total Posts: 3328 |
|
|
| 14 Aug 2013 07:37 PM |
Any help? :/
*facepalm*facedesk*facewall*facefloor*facepop*facetree*facesand*facecake* |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2013 08:06 PM |
| That script just makes it to where it doesn't register the touched event more than once. So you only get one forcefield per touch, is what the script is doing. If you wanted to make it a one time use, you have the wrong script. |
|
|
| Report Abuse |
|
|
Jro1311
|
  |
| Joined: 01 Jun 2013 |
| Total Posts: 3328 |
|
|
| 14 Aug 2013 08:27 PM |
I mean that if a player touched a brick and they got FF they can't get it another time unless they die.
*facepalm*facedesk*facewall*facefloor*facepop*facetree*facesand*facecake* |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2013 01:42 AM |
| Make it insert something into the character along with the forcefield and add a check to see if it`s not there first. -Derp- |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 15 Aug 2013 02:00 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil and h:findFirstChild("hax") == false then local hax=Instance.new("Model", h.Parent) hax.Name = "hax" local ff = Instance.new("ForceField", h) ff.Parent = part.Parent wait(0.1) elseif h~=nil and h:findFirstChild("hax") == true then return end end
if (script.Parent ~= nil) and (script.Parent.className == "Part") then connection = script.Parent.Touched:connect(onTouched) end
Maybe this will work... |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 15 Aug 2013 02:02 AM |
| Oops. I didn't realize that h was humanoid. Replace my "h"s with "part.Parent" |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 15 Aug 2013 02:03 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil and part.Parent:findFirstChild("hax") == false then local hax=Instance.new("Model", h.Parent) hax.Name = "hax" local ff = Instance.new("ForceField", part.Parent) wait(0.1) elseif h~=nil and part.Parent:findFirstChild("hax") == true then return end end
if (script.Parent ~= nil) and (script.Parent.className == "Part") then connection = script.Parent.Touched:connect(onTouched) end
There. This will work better |
|
|
| Report Abuse |
|
|