Change Base Skins Tutorial
Автор: Tutorials Lite
Загружено: 2026-01-26
Просмотров: 32
Описание:
model = 107398504693015
localscript = https://pastebin.com/MMMVXrb3
script = local Players = game:GetService("Players")
local Bases = {
workspace.Base1,
workspace.Base2,
workspace.Base3
}
local function getFreeBase()
for _, base in ipairs(Bases) do
local owner = base:FindFirstChild("Owner")
if owner and owner.Value == "None" then
return base
end
end
end
Players.PlayerAdded:Connect(function(player)
local base = getFreeBase()
if not base then return end
base.Owner.Value = player.Name
local signGui = base.Sign.Sign.SignGui
signGui.SignTextLabel.Text = player.Name .. "'s Base"
player.CharacterAdded:Connect(function(character)
local hrp = character:WaitForChild("HumanoidRootPart")
task.wait(0.1)
if base:FindFirstChild("Spawner") then
hrp.CFrame = base.Spawner.CFrame + Vector3.new(0,5,0)
end
end)
end)
Players.PlayerRemoving:Connect(function(player)
for _, base in ipairs(Bases) do
local owner = base:FindFirstChild("Owner")
if owner and owner.Value == player.Name then
owner.Value = "None"
base.Sign.Sign.SignGui.SignTextLabel.Text = "Unclaimed Base"
end
end
end)
script = local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local RemoteEvent = ReplicatedStorage:FindFirstChild("ChangeBaseColor")
if not RemoteEvent then
RemoteEvent = Instance.new("RemoteEvent")
RemoteEvent.Name = "ChangeBaseColor"
RemoteEvent.Parent = ReplicatedStorage
end
local Bases = {
workspace:WaitForChild("Base1"),
workspace:WaitForChild("Base2"),
workspace:WaitForChild("Base3")
}
local rainbowBases = {}
-- Store the original colors of every part in every base
for _, base in ipairs(Bases) do
for _, part in ipairs(base:GetDescendants()) do
if part:IsA("BasePart") then
part:SetAttribute("DefaultColor", part.Color)
end
end
end
local function getPlayerBase(player)
for _, base in ipairs(Bases) do
local owner = base:FindFirstChild("Owner")
if owner and owner.Value == player.Name then
return base
end
end
end
local function setBaseColor(base, colorType)
for _, part in ipairs(base:GetDescendants()) do
if part:IsA("BasePart") then
if colorType == "Default" then
local defaultColor = part:GetAttribute("DefaultColor")
if defaultColor then
part.Color = defaultColor
end
elseif colorType == "Night" then
part.Color = Color3.fromRGB(0,0,0)
elseif colorType == "Gold" then
part.Color = Color3.fromRGB(255,215,0)
end
end
end
end
RunService.Heartbeat:Connect(function()
local hue = tick() % 6 / 6
local color = Color3.fromHSV(hue,1,1)
for base in pairs(rainbowBases) do
if base.Parent then
for _, part in ipairs(base:GetDescendants()) do
if part:IsA("BasePart") then
part.Color = color
end
end
else
rainbowBases[base] = nil
end
end
end)
RemoteEvent.OnServerEvent:Connect(function(player, colorType)
local base = getPlayerBase(player)
if not base then return end
rainbowBases[base] = nil
if colorType == "Rainbow" then
rainbowBases[base] = true
else
setBaseColor(base, colorType)
end
end)
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: