I dont get it. As soon as the Shoot() function starts, it INSTANTLY SKIPS THE ENTIRE WAIT! PLEASE! SOMEONE HELP! THIS IS DRIVING ME INSANE! Here is the script that is getting on my nerves....
local AllowInput = false
if game.Players:GetPlayerFromCharacter(script.Parent) then
AllowInput = true
spawn(function()
while wait() do
if script:WaitForChild('ref').Value.Value ~= script:WaitForChild('ref'):WaitForChild('ref').Value.Name then
script:Destroy()
end
end
end)
end
function Shoot(mousepos)
local object = script.Libraries.Object.LazerExample:Clone()
object.Parent = script.Parent
object.Position = mousepos[1] + Vector3.new(0,1024,0)
for i = 0,1,-0.01 do
object.Transparency = i
wait(1000000000000000000000000000000000000)
end
print('done')
if object.Parent and object then
object:Destroy()
end
end
script.Input.Value.Event:Connect(function(Action)
if not AllowInput then return end
if Action[1] == '1' then
script:WaitForChild('ref'):WaitForChild('ref'):WaitForChild('ref').Value.Value = true
Shoot(Action[2])
script:WaitForChild('ref'):WaitForChild('ref'):WaitForChild('ref').Value.Value = false
--[[
script.Parent.Humanoid.WalkSpeed = 0.5
script.Parent.Humanoid.JumpPower = 0
script.Parent.GunnerAnimate.Disabled = true
Shoot(Action[2])
script.Parent.GunnerAnimate.Disabled = false
script.Parent.Humanoid.WalkSpeed = 16
script.Parent.Humanoid.JumpPower = 50
script:WaitForChild('ref'):WaitForChild('ref'):WaitForChild('ref').Value.Value = false
]]
end
end)

1 comment
I see, the problem is that the wait() is inside the function, you will probably have to put it outside the function, I hope my answer was helpful