local E=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Z=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local w=script.Parent local c={}local n=false local X=false local e=1 local Q=nil local B=nil w.Activated:Connect(function()if not X then X=true task.delay(e,function()X=false end)local f=w.Parent if not n then n=true B=f.Humanoid:LoadAnimation(E.GhoulV4.Laugh)B:Play()f.HumanoidRootPart.Anchored=true Q=E.GhoulV4.Props.Wings:Clone()Q.Parent=f local w=Instance.new("\065\116\116\097\099\104\109\101\110\116")w.Parent=f.HumanoidRootPart w.Position=Vector3.new(0,-2.5,0)local X=E.GhoulV4.Effects.Wave:Clone()X.Parent=w local e=E.GhoulV4.Effects.Smoke:Clone()e.Parent=f.HumanoidRootPart local h=E.GhoulV4.Effects.Pixel:Clone()h.Parent=f.HumanoidRootPart local U=E.GhoulV4.Sound.Laugh:Clone()U.Parent=f.HumanoidRootPart local V=E.GhoulV4.Sound.Smoke:Clone()V.Parent=f.HumanoidRootPart U:Play()task.delay(1.6,function()U:Destroy()task.wait(.25)f.HumanoidRootPart.Anchored=false B:Stop()end)V:Play()local g=Z:Create(V,TweenInfo.new(1.5),{Volume=0})g:Play()g.Completed:Connect(function()V:Destroy()end)X:Emit(2)e:Emit(100)h:Emit(50)for E,Z in ipairs(f.Humanoid:GetAccessories())do local w=Z.Handle:FindFirstChild("\072\097\105\114\065\116\116\097\099\104\109\101\110\116")~=nil if w then c[Z]={TextureID=Z.Handle.TextureID,Color=Z.Handle.Color,Material=Z.Handle.Material}Z.Handle.Color=Color3.fromRGB(255,0,0)Z.Handle.TextureID=""Z.Handle.Material=Enum.Material.Neon end end elseif n then n=false local E=Z:Create(Q.Handle,TweenInfo.new(.5),{Transparency=1})E:Play()E.Completed:Connect(function()Q:Destroy()end)for E,Z in ipairs(f.Humanoid:GetAccessories())do local w=Z.Handle:FindFirstChild("\072\097\105\114\065\116\116\097\099\104\109\101\110\116")~=nil if w then Z.Handle.Color=c[Z].Color Z.Handle.Material=c[Z].Material Z.Handle.TextureID=c[Z].TextureID c[Z]=nil end end end end end)


local RS = game:GetService('ReplicatedStorage')
local TS = game:GetService('TweenService')

local Tool = script.Parent
local TextureArray = {}

local Activated = false
local Debounce = false
local Cooldown = 1
local Prop = nil
local LaughAnim = nil

Tool.Activated:Connect(function()
	if not Debounce then
		Debounce = true
		task.delay(Cooldown, function()
			Debounce = false
		end)
		
		local Character = Tool.Parent
		
		if not Activated then
			Activated = true
			
			LaughAnim = Character.Humanoid:LoadAnimation(RS.GhoulV4.Laugh)
			LaughAnim:Play()
			Character.HumanoidRootPart.Anchored = true
			
			Prop = RS.GhoulV4.Props.Wings:Clone()
			Prop.Parent = Character
	 
			local Attachment = Instance.new('Attachment')
			Attachment.Parent = Character.HumanoidRootPart
			Attachment.Position = Vector3.new(0,-2.5,0)

			local Wave = RS.GhoulV4.Effects.Wave:Clone()
			Wave.Parent = Attachment

			local Smoke = RS.GhoulV4.Effects.Smoke:Clone()
			Smoke.Parent = Character.HumanoidRootPart

			local Pixel = RS.GhoulV4.Effects.Pixel:Clone()
			Pixel.Parent = Character.HumanoidRootPart

			local Laugh = RS.GhoulV4.Sound.Laugh:Clone()
			Laugh.Parent = Character.HumanoidRootPart

			local SmokeSound = RS.GhoulV4.Sound.Smoke:Clone()
			SmokeSound.Parent = Character.HumanoidRootPart

			Laugh:Play()

			task.delay(1.6,function()
				Laugh:Destroy()
				task.wait(0.25)
				Character.HumanoidRootPart.Anchored = false
				LaughAnim:Stop()
			end)

			SmokeSound:Play()

			local Tween = TS:Create(SmokeSound, TweenInfo.new(1.5), {Volume = 0})
			Tween:Play()

			Tween.Completed:Connect(function()
				SmokeSound:Destroy()
			end)	

			Wave:Emit(2)
			Smoke:Emit(100)
			Pixel:Emit(50)

			for _, Item in ipairs(Character.Humanoid:GetAccessories()) do
				local Hair = Item.Handle:FindFirstChild("HairAttachment") ~= nil
				if Hair then
					TextureArray[Item] = {TextureID = Item.Handle.TextureID, Color = Item.Handle.Color, Material = Item.Handle.Material}
					Item.Handle.Color = Color3.fromRGB(255, 0, 0)
					Item.Handle.TextureID = ''
					Item.Handle.Material = Enum.Material.Neon
				end
			end
			
		elseif Activated then
			Activated = false
			
			local Tween = TS:Create(Prop.Handle, TweenInfo.new(0.5), {Transparency = 1})
			Tween:Play()

			Tween.Completed:Connect(function()
				Prop:Destroy()
			end)
			
			for _, Item in ipairs(Character.Humanoid:GetAccessories()) do
				local Hair = Item.Handle:FindFirstChild("HairAttachment") ~= nil
				if Hair then
					Item.Handle.Color = TextureArray[Item].Color
					Item.Handle.Material = TextureArray[Item].Material
					Item.Handle.TextureID = TextureArray[Item].TextureID
					TextureArray[Item] = nil
				end
			end
		end
	end
end)
