local R=script.Parent enabled=true local l=nil function makeMeGhostly(R)if l==nil then return end local a={"\072\101\097\100","\084\111\114\115\111";"\076\101\102\116 \076\101\103";"\082\105\103\104\116 \076\101\103","\076\101\102\116 \065\114\109","\082\105\103\104\116 \065\114\109";"\085\112\112\101\114\084\111\114\115\111";"\076\111\119\101\114\084\111\114\115\111","\082\105\103\104\116\085\112\112\101\114\065\114\109","\082\105\103\104\116\076\111\119\101\114\065\114\109";"\082\105\103\104\116\072\097\110\100";"\076\101\102\116\072\097\110\100","\076\101\102\116\076\111\119\101\114\065\114\109","\076\101\102\116\085\112\112\101\114\065\114\109","\076\101\102\116\076\111\119\101\114\076\101\103","\076\101\102\116\085\112\112\101\114\076\101\103";"\082\105\103\104\116\076\111\119\101\114\076\101\103","\082\105\103\104\116\085\112\112\101\114\076\101\103";"\082\105\103\104\116\070\111\111\116";"\076\101\102\116\070\111\111\116"}for M=1,#a,1 do local U=l:FindFirstChild(a[M])if U~=nil then U.Transparency=R end end end function UpdateGhostState(a)if a==true then makeMeGhostly(0)l=nil else l=R.Parent makeMeGhostly(.5)end end function onActivated()if not enabled then return end enabled=false R.GripForward=Vector3.new(-0.981,.196,0)R.GripPos=Vector3.new(-0.5,-0.6,-1.5)R.GripRight=Vector3.new(0,0,-1)R.GripUp=Vector3.new(.196,.981,0)R.Handle.DrinkSound:Play()wait(.8)local l=R.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")if l~=nil then UpdateGhostState(false)end R.GripForward=Vector3.new(-1,0,0)R.GripPos=Vector3.new(-0.5,-0.1,0)R.GripRight=Vector3.new(0,0,1)R.GripUp=Vector3.new(0,1,0)enabled=true end function onEquipped()R.Handle.OpenSound:play()end script.Parent.Activated:connect(onActivated)script.Parent.Equipped:connect(onEquipped)function onUnequipped()UpdateGhostState(true)end script.Parent.Unequipped:connect(onUnequipped)
--Updated for R15 avatars by StarWars
local Tool = script.Parent

enabled = true

local ghostChar = nil

function makeMeGhostly(trans)
	if ghostChar == nil then
		return
	end
	local parts = {
		"Head",
		"Torso",
		"Left Leg",
		"Right Leg",
		"Left Arm",
		"Right Arm",
		"UpperTorso",
		"LowerTorso",
		"RightUpperArm",
		"RightLowerArm",
		"RightHand",
		"LeftHand",
		"LeftLowerArm",
		"LeftUpperArm",
		"LeftLowerLeg",
		"LeftUpperLeg",
		"RightLowerLeg",
		"RightUpperLeg",
		"RightFoot",
		"LeftFoot",
	}

	for i = 1, #parts do
		local p = ghostChar:FindFirstChild(parts[i])
		if p ~= nil then
			p.Transparency = trans
		end
	end
end

function UpdateGhostState(isUnequipping)
	if isUnequipping == true then
		makeMeGhostly(0)
		ghostChar = nil
	else
		ghostChar = Tool.Parent
		makeMeGhostly(0.5)
	end
end

function onActivated()
	if not enabled then
		return
	end

	enabled = false
	Tool.GripForward = Vector3.new(-0.981, 0.196, 0)
	Tool.GripPos = Vector3.new(-0.5, -0.6, -1.5)
	Tool.GripRight = Vector3.new(0, -0, -1)
	Tool.GripUp = Vector3.new(0.196, 0.981, 0)

	Tool.Handle.DrinkSound:Play()

	wait(0.8)

	local h = Tool.Parent:FindFirstChild("Humanoid")
	if h ~= nil then
		UpdateGhostState(false)
	end

	Tool.GripForward = Vector3.new(-1, 0, 0)
	Tool.GripPos = Vector3.new(-0.5, -0.1, 0)
	Tool.GripRight = Vector3.new(0, 0, 1)
	Tool.GripUp = Vector3.new(0, 1, 0)

	enabled = true
end

function onEquipped()
	Tool.Handle.OpenSound:play()
end

script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

function onUnequipped()
	UpdateGhostState(true)
end

script.Parent.Unequipped:connect(onUnequipped)
