Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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)


1
is this local script or server script? Leamir 3138 — 4y
0
it's a server script in startercharacterscripts srimmbow 241 — 4y
1
it should be a local script iivSnooxy 248 — 4y

Answer this question