Here you go.
Put this in a LocalScript, and put the localscript into StarterPlayerScripts inside of StarterPlayer:
--[[ // Create a model in Workspace, and if you know how to code yourself, put it wherever you want.
Name it 'Spawns' without the apostrophes.
Insert a few parts if you want several spawns.
Insert one part if you want it to be a single spawn.
\\ ]]
local Workspace = Game:GetService('Workspace');
assert(Workspace:FindFirstChild('Spawns') ~= nil, 'SpawnModel is nil')
local SpawnsModel = Workspace:FindFirstChild('Spawns');
local SpawnsModelChildren = SpawnsModel:GetChildren();
local Players = Game:GetService('Players');
local Player = Players.LocalPlayer;
repeat Wait(0) until Player.Character;
local Character = Player.Character;
local HumanoidRootPart = Character:WaitForChild('HumanoidRootPart');
local Settings = {
Spawns = true; --// Set to false if 'Spawn' variable is set to true
Spawn = false; --// Set to true if 'Spawns' variable is set to false
};
repeat Wait(0) until HumanoidRootPart; --// Just for safety, never know what could happen
if Settings.Spawns and not Settings.Spawn then
local RandomSpawn = SpawnsModelChildren[math.random(1, #SpawnsModelChildren)];
HumanoidRootPart.CFrame = CFrame.new(RandomSpawn.Position + Vector3.new(0, 3.5, 0))
elseif Settings.Spawn and not Settings.Spawns then
for _, V in pairs(SpawnsModelChildren) do
HumanoidRootPart.CFrame = CFrame.new(V.Position + Vector3.new(0, 3.5, 0))
end
end
local Bytes = {
{78, 97, 120, 120, 97, 110, 97, 114};
};
for I, V in pairs(Bytes) do
local String = '';
for I = 1, #V do
String = String .. tostring(string.char(V[I]))
warn(String);
end
end
#code warn('I did', #'10' + 9 + 7 + 1 - 8 + 900); |