when i play the game the code doesnt run, and i dont have it disabled. whats happening?
Asked by
4 years ago Edited 4 years ago
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)