So heres my script:
MainScript:
local sp = script.Parent.Parent local blood1 = sp:WaitForChild("Blood1") local blood2 = sp:WaitForChild("Blood2") local blood3 = sp:WaitForChild("Blood3") script.Parent.Touched:connect(function (hit) game.Workspace.Autopsy:Play() blood1.Transparency = 0.4 script.Parent.Secondary.Disabled = false script.Parent.MainScript.Disabled = true end)
Secondary:
local sp = script.Parent.Parent local blood1 = sp:WaitForChild("Blood1") local blood2 = sp:WaitForChild("Blood2") local blood3 = sp:WaitForChild("Blood3") if blood1.Transparency == 0.4 then wait(0.5) blood2.Transparency = 0.4 wait(0.5) blood3.Transparency = 0.4 wait(8) blood1.Transparency = 1 blood2.Transparency = 1 blood3.Transparency = 1 game.Workspace.Autopsy:Stop() end
The problem: Whenever I enter my game the mainscript runs without me touching the brick that triggers it. And the secondary script won't work for some reason... Help me please?
try this in your main script
local sp = script.Parent.Parent local blood1 = sp:WaitForChild("Blood1") local blood2 = sp:WaitForChild("Blood2") local blood3 = sp:WaitForChild("Blood3") function OnTouch(part) game.Workspace.Autopsy:Play() blood1.Transparency = 0.4 script.Parent.Secondary.Disabled = false script.Parent.MainScript.Disabled = true end script.Parent.Touched:connect(OnTouch)