Universal Script 📌
4.1k Views
20 Executions

Blocky P3ts

Universal Script 📌
skibidimariodisney
skibidimariodisneyPublished 10
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Pet block Simple Lag warning

View Raw
local Players    = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace  = game:GetService("Workspace")

local LocalPlayer = Players.LocalPlayer
local Character   = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local HRP         = Character:WaitForChild("HumanoidRootPart")

local MAX_BLOCKS    = 100
local DETECT_RADIUS = 30
local WANDER_RADIUS = 50
local INTERACT_DIST = 5

local spawnableParts = {}
for _, obj in ipairs(Workspace:GetDescendants()) do
    if obj:IsA("BasePart") and obj.CanCollide and not obj:IsDescendantOf(Character) then
        table.insert(spawnableParts, obj)
    end
end

local function randomPointOnPart(part)
    local s = part.Size * 0.5
    local offset = Vector3.new(
        math.random(-s.X, s.X),
        math.random(-s.Y, s.Y),
        math.random(-s.Z, s.Z)
    )
    return part.Position + offset
end

local wanderers = {}

local function spawnWanderer(atPlayerPosition)
    local spawnPos
    if atPlayerPosition and math.random() < 0.5 then
        spawnPos = HRP.Position + Vector3.new(0,2,0)
    else
        local part = spawnableParts[math.random(1,#spawnableParts)]
        spawnPos = randomPointOnPart(part)
    end


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
125
459
Bumped 10 minutes ago
Key System
Universal Script 📌
1.3M
592.0k
Bumped 2 hours ago
Script hub
2.5k
19.5k
Bumped 3 hours ago
Universal Script 📌
298
603
Approved 4 hours ago
Universal Script 📌
74
858
Approved 5 hours ago
Universal Script 📌
104
96
Approved 6 hours ago