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

Why is there so much Lag on my place? [SOLVED] :D

Asked by 9 years ago
Value6 = script.Parent
ImAwesome = 0
function onTouch()
    if ImAwesome == 0 then
        ImAwesome = 1
        local Value1 = Instance.new("Vector3Value", script.Parent)
        Value1.Value = Value6.Position + Vector3.new(-6,0,6)
        local t = Value1.Value.X
        local u = Value1.Value.Z
        local Value2 = "[".. t ..", ".. u .."]"
        if workspace.Blocks:findFirstChild(Value2) then
            else
            local notavalue = Value6:clone()
            notavalue.CanCollide = false
            notavalue.Transparency = 1
            notavalue.Parent = game.Workspace.Blocks
            notavalue.Position = Value6.Position + Vector3.new(-6,0,6)
            wait()
            if notavalue.Position.Y >= 2 then
                notavalue:destroy()
            else
            notavalue.CanCollide = true
            notavalue.Transparency = 0
            end
        end
        else
    end
    wait(5)
    ImAwesome = 0 -- I Really Am
end

script.Parent.Touched:connect(onTouch)

Thats the largest script in the place and i dont know what is causing it to create s much lag. At first there is no lag but after about 20 Parts being cloned it Lags whenever you try to clone anything. The Place is Uncopylocked so you can see what im trying to do and see what is causing the lag.

http://www.roblox.com/games/276878221/SamTheDevelopers-Place-Number-21

(Never got round to Re-Naming it :3)

Answer this question