RiderjJoin Date: 2011-08-15 Post Count: 1534 |
I have an issue, this will not work on my script builder:
elseif Action == "Laser" then
while ispressing == true do
wait(.1)
Hit.Parent.Humanoid:TakeDamage(math.random(1,5))
ray = Ray.new(Handle.CFrame.p,(mouse.Hit.p-Handle.CFrame.p).unit*300)
Hit,Position = game.Workspace:FindPartOnRay(ray,player.Character)
TraceRay(Handle.CFrame.p,Position)
end
end
This does work though:
local r = false
while r == false do
wait()
print("R")
end
I removed the wait in my first script, and it worked. So I was assuming it was the re-write of my wait function to work with my error handling. I realized it was not, because the second example works. Here is the re-write of my wait:
env.wait = function(time)
if coroutine.running() == FError then
delay(time,function()
IsError,Output = coroutine.resume(FError)
if not IsError then
out.OutputValue.Value = out.OutputValue.Value..Output:gsub("%[(.*)%]:","") .. " "
out.OutputValue.NumMessages.Value = out.OutputValue.NumMessages.Value + 1
coroutine.resume(coroutine.create(function()
wait(5)
script:Destroy()
end))
end
end)
coroutine.yield(FError)
else
wait(time)
end
return true
end
I have spent hours so far trying to solve this issue, I just cannot see what is wrong.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Nobody can help?
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
-.-
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
micol2242Join Date: 2010-11-13 Post Count: 4732 |
Is the 'ispressing' part of it true?
--what is this i dont even-- |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Everything works.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Everything is defined.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
Grove537Join Date: 2010-02-05 Post Count: 3478 |
Why do you have elseif at the top and not just if?
~The greatest free model is your mind~ |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
It is inside another if.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Hmph
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
2tallhankJoin Date: 2010-06-11 Post Count: 2075 |
[ Content Deleted ] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Well that is no use to me.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
48 views and only about 11 responses.
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
SDuke524Join Date: 2008-07-29 Post Count: 6267 |
Can I see your `TraceRay` function? |
|
SDuke524Join Date: 2008-07-29 Post Count: 6267 |
> 48 views and only about 11 responses.
My questions usually get 300 views before 11 responses, excluding my bumps. |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
May I note, this works in every other SB besides mine, and sure.
function TraceRay(pos1,pos2)
local RayPart = Instance.new("Part",player.Character)
RayPart.Anchored = true
RayPart.CanCollide = false
RayPart.TopSurface = 0
RayPart.BottomSurface = 0
RayPart.LeftSurface = 0
RayPart.RightSurface = 0
RayPart.BrickColor = BrickColor.random()
RayPart.FormFactor = "Custom"
local Distance = (pos2-pos1).magnitude
RayPart.Size = Vector3.new(0.2,.2,Distance)
RayPart.CFrame = CFrame.new(pos2,pos1) * CFrame.new(0,0,-Distance/2)
game.Debris:AddItem(RayPart,.1)
end
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
SDuke524Join Date: 2008-07-29 Post Count: 6267 |
Oh, well then obviously the problem is your script builder. |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
If you would like to help live ( I would appriciate it greatly) will you respond back and I will message you a sync.in to meet me at?
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
appreciate*
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|
RiderjJoin Date: 2011-08-15 Post Count: 1534 |
Fixed it finally :O
[[ 7/10 - Scripting| 4/10 - Building | 10/10 - Confused ]] |
|