Roblox studio:
robloxapp-20241129-2234098.wmv (1.6 MB)
Public game:
robloxapp-20241129-2235078.wmv (1.5 MB)
local T1 = group:WaitForChild("BadTouch1")
local T2 = group:WaitForChild("BadTouch2")
local Arm = group:WaitForChild("EnemyLongArmCutscene")
local cube = Arm:WaitForChild("Cube.001")
local humanoid = Arm:FindFirstChild("Humanoid")
local animator = humanoid:FindFirstChild("Animator") or Instance.new("Animator", humanoid)
local animationId = "rbxassetid://83625405610602"
local animationId2 = "rbxassetid://126781645605788"
local animation = Instance.new("Animation")
local animation2 = Instance.new("Animation")
animation.AnimationId = animationId
animation2.AnimationId = animationId2
local animationTrack = animator:LoadAnimation(animation)
local animationTrack2 = animator:LoadAnimation(animation2)
local function playAnimation2()
if not animationTrack.IsPlaying then
animationTrack2:Play()
animationTrack2:AdjustSpeed(1)
end
end
local ventsound = cube:WaitForChild("Metal 50 Gallon Drum Rolling On Edge 2 (SFX)")
ventsound:Play()
playAnimation2()
local function playAnimation()
if not animationTrack.IsPlaying then
animationTrack:Play()
animationTrack:AdjustSpeed(1)
end
end
local debounce = false
animationTrack2.Ended:Connect(function()
playAnimation()
end)
local soundWater = cube:WaitForChild("Watermelon Splat 1 (SFX)")
local handsound = cube:WaitForChild("Spider Footsteps 3 (SFX)")
local replicage = game.ReplicatedStorage
local event = replicage:WaitForChild("Monster_AI"):WaitForChild("Jumpscare")
local npc = workspace:WaitForChild("LongArmJumpscare")
local cube = npc["Cube.001"].JumpscareSound
animationTrack:GetMarkerReachedSignal("FirstTouch"):Connect(function()
T1.CanTouch = true
T2.CanTouch = false
handsound:Play()
print("T1")
end)
animationTrack:GetMarkerReachedSignal("SecondTouch"):Connect(function()
T2.CanTouch = true
T1.CanTouch = false
soundWater:Play()
print("T2")
end)
animationTrack:GetMarkerReachedSignal("Leave"):Connect(function()
T2.CanTouch = false
T1.CanTouch = false
print("Leave")
task.wait(1)
animationTrack:AdjustSpeed(0)
end)
local d = false
local function isPlayer(part)
local character = part.Parent
if character and character:FindFirstChild("Humanoid") then
return game.Players:GetPlayerFromCharacter(character)
end
return nil
end
local debounce = false
local function handleTouch(touchPart, event, npc, cube)
touchPart.Touched:Connect(function(hit)
local player = isPlayer(hit)
if player and not debounce then
debounce = true
print(touchPart.Name .. " TOUCHED by", player.Name)
task.wait(0.5)
debounce = false
event:FireClient(player, npc)
cube:Play()
local character = player.Character
if character and character:FindFirstChild("Humanoid") then
character.Humanoid.Health = 0
end
end
end)
end
handleTouch(T1, event, npc, cube)
handleTouch(T2, event, npc, cube)
I’m not really sure what cause all of this, it also happen to some of my animation too.