local UIS = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Target = ReplicatedStorage["BALACLAVA_2"]
local toggled = false

UIS.InputBegan:connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.E then
		if toggled == false then
			newTarget = Target:Clone()
			head = script.Parent:WaitForChild('Head')
			
			newTarget.Parent = head
			
			weld = Instance.new("Weld")
			weld.Parent = head
			weld.Part0 = head
			weld.Part1 = newTarget
			
			for i, v in pairs(head.Parent:GetChildren()) do
				if v:IsA("Accessory") then
					v.Handle.Transparency = 1
				end
			end
			
			toggled = true
		else
			toggled = false
			newTarget:Destroy()
			weld:Destroy()
			for i, v in pairs(head.Parent:GetChildren()) do
				if v:IsA("Accessory") then
					v.Handle.Transparency = 0
				end
			end
		end
	end
end)


3 comments

1

is this local script or server script?

0

it's a server script in startercharacterscripts

1

it should be a local script