Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keeps SAYING Disconnected Event? (UNSOLVED)

Asked by 10 years ago

How can I make this run multiple times??? It only runs one time then it says in the output, "Disconnected event cause of exception".

debounce=false



function onTouched(hit)
    local humanoid=hit.Parent:FindFirstChild("Humanoid")
    local cake=hit.Parent.Name
    local player=game.Players[cake]
    local deadv=player:WaitForChild("Dead")--FindFirstChild("Dead")

    --if not debounce then
    --  debounce=true
    --if humanoid then if (debounce==false) then
    --if (hit.Parent.PrimaryPart=="Head") then
    --if (hit.Parent:FindFirstChild("ZAnimate")) then return-- debounce=false
    if (debounce==false) then
        if (humanoid ~= nil) then 
            if (deadv.Value==true) then

    if (player.TeamColor==game.Teams.Zombies.TeamColor) then
        debounce=true
    local zom=game.Lighting.Zombies[player.Class.Value].ZAnimate:Clone()
    zom.Parent=humanoid.Parent
    zom.Disabled=false
    --hit.Parent:FindFirstChild("RobloxTeam"):remove()
    hit.Parent:FindFirstChild("Sound"):remove()
    hit.Parent:FindFirstChild("Animate"):remove()
    debounce=false
        end end end end end
--script.Parent.Touched:connect(onTouched)
--[[
function Start(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then print("Ok Started!")]]--

script.Parent.Touched:connect(onTouched)


--[[
end
end
script.Parent.Touched:connect(Start)]]--
0
Can you please tell the whole error message? Redbullusa 1580 — 10y
0
It says, "Disconnected event cause of exception". PancakeAttacks 0 — 10y

1 answer

Log in to vote
0
Answered by
Mr_Octree 101
10 years ago

Hmm, I am not sure where the error might be. Something that I would do is call the print() function in-between each line to see where the script stops running. I've used this method several times and it has proved to be successful. Hope this helps.

Ad

Answer this question