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

idk whats wrong with this script no errors,but i parents it when it need to copy it how do i fix?

Asked by 5 years ago

its r to transform and e to go back

local unfrom = false
local plr = game.Players.LocalPlayer
local chr = plr.Character

local ref = game.Workspace.Part
local hum = chr:WaitForChild("Humanoid")
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(input)
local val = script.Parent.Transfrombodything.OFFORON




-- on 
    local key = input.KeyCode 
    if key == Enum.KeyCode.R then
    if unfrom == false then
    val.Value = "OFF"

    for _,body in pairs(chr:GetChildren()) do
        if body:IsA("BasePart") then
            body.BrickColor = BrickColor.new("Gold")
            body.Material = "Neon"
        end
        for _,size in pairs(hum:GetChildren())do
            if size:IsA("NumberValue") then
                size.Value = 5



            end

            -- "BodyDepthScale" or "BodyWidthScale" or "HeadScale" then
                    --resize.Value = 7
        hum:WaitForChild("BodyDepthScale").Value = 10
        hum:WaitForChild("BodyWidthScale").Value = 7.89
        hum:WaitForChild("HeadScale").Value = 6
        unfrom = true

        end

    end
end
    end
end)
-----



--off

InputService.InputBegan:Connect(function(input)
    local plr = game.Players.LocalPlayer
local chr = plr.Character
local hum = chr.Humanoid
    local key = input.KeyCode 
    if key == Enum.KeyCode.E then


    if unfrom == true then


    local tem = script.Parent.Transfrombodything:WaitForChild("OFFORON")
    if tem.Value == "ON" then
        tem.Value = "OFF"
    end
    if tem.Value == "OFF" then
        for _,tr in pairs(script.Parent.Transfrombodything:GetChildren()) do
            if tr:IsA("NumberValue") then
                --local copy = tr:Clone()
                for _,kill in pairs(hum:GetChildren()) do

                    if kill:IsA("NumberValue") then
                    kill.Value = 2
                    wait(.12)
                        --copy.Parent = hum
                    end
                end
            end
        end

        end





    end
end
unfrom = false
end)





Answer this question