hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
|
| 20 Feb 2016 08:08 AM |
a = 6.93 debounce = true
local part = script.Parent part.Touched:connect(debounce(function(hit) if hit.Parent then local hum = hit.Parent:findFirstChild('Humanoid') if hum then script.Parent.CFrame = CFrame.new (4, 6.93, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.1, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.2, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.3, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.4, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.5, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.6, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.7, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.8, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 7.9, 3.93) wait(0.1) script.Parent.CFrame = CFrame.new (4, 8, 3.93) if script.Parent.CFrame == CFrame.new (4, 6.93, 3.93) then debounce = true end if script.Parent.CFrame == CFrame.New (4, 8, 3.93) then debounce = false end end end end))
the part never rises once I get on it, is the debounce too true, is there any problems with this code?
PLEASE TELL ME |
|
|
| Report Abuse |
|
|
hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
|
| 20 Feb 2016 08:10 AM |
why do I need that a = 6.93
im removing that from script though |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 20 Feb 2016 08:14 AM |
the inefficiency in this one is intense.. here's something that *miiight* just work:
local debounce = false local part = script.Parent part.Touched:connect(function(hit) if hit.Parent then local hum = hit.Parent:findFirstChild("Humanoid") end if hum then for i = 6.93, 8, 0.1 do wait(0.1) script.Parent.CFrame = CFrame.new(4, i, 3.93) end end end if script.Parent.CFrame == CFrame.new(4, 6.93, 3.93) then debounce = true end
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
|
| Report Abuse |
|
|
hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
| |
|
|
| 20 Feb 2016 08:21 AM |
btw his isnt any less efficient, its just not as readable, im not the only one who disagrees, check this out if you dont believe me
http://forum.roblox.com/Forum/ShowPost.aspx?PostID=180824440
#Strikin' |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 20 Feb 2016 08:22 AM |
at least paste in what the output returned, you nimrod
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
|
| Report Abuse |
|
|
hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
|
| 20 Feb 2016 08:24 AM |
| okay misterobvious-- I MEAN oni0n |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 20 Feb 2016 08:24 AM |
@electro
his code is literally making a part go upwards at an increment of 0.1 studs.. and instead of using a for loop (for variable = pointA, pointB, increment), he's copy-pasting each line and editing the X-axis
if you don't think that's inefficient, rather unreadable, i think you should go worship cnt as your god
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
|
| Report Abuse |
|
|
hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
|
| 20 Feb 2016 08:30 AM |
hey copy pasting is fun
I think its better than
a = 3
repeat game.Workspace.Part.Position = Vector3.new (1,3,3) wait(.01) a=a+.05 until game.Workspace.Part.Position = Vector3.new (1,10,3)
something like that |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:30 AM |
a = 6.93 debounce = true
local part = script.Parent part.Touched:connect(debounce(function(hit) if debounce then if hit.Parent then local hum = hit.Parent:findFirstChild('Humanoid') if hum then local co = coroutine.create(function() script.Parent.Changed:connect(function() if script.Parent.CFrame == CFrame.new(4,a,3.93) then debounce = true elseif script.Parent.CFrame == CFrame.new(4, 8, 3.93) then debounce = false end end) coroutine.resume(co) script.Parent.CFrame = CFrame.new(4,a,3.93) repeat script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0.1,0) wait(0.1) until script.Parent.CFrame = CFrame.new(4,8,2.93) end end end
try that, don't come saying it doesnt work b4 you dont tweak it.
#Strikin' |
|
|
| Report Abuse |
|
|
hboogy101
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 1392 |
|
|
| 20 Feb 2016 08:31 AM |
| lol jk I just did the copy-paste for fun |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:33 AM |
:/
E = MC^2/Energy = Mass x 300,00km/s^2 |
|
|
| Report Abuse |
|
|