Top.Mail.Ru
Ответы
Аватар пользователя
Аватар пользователя
Аватар пользователя
Аватар пользователя
Программирование
+2

Всем привет, скрипт работает только в roblox studio а в самом роблоксе нет посмотрите пожалуйста в чем проблема,

гуи появляется кнопки не работают

if not game:IsLoaded() then

game.Loaded:Wait()

end

print("Скрипт запущен на клиенте")

local player = game.Players.LocalPlayer

local gui = player:WaitForChild("PlayerGui"):WaitForChild("CarBuilderGui")

local frame = gui:WaitForChild("Frame")

local statusLabel = frame:WaitForChild("StatusLabel")

print("бульмени")

local addCanister = frame:WaitForChild("AddCanister")

local addWheel = frame:WaitForChild("AddWheel")

local addEngine = frame:WaitForChild("AddEngine")

local checkBuild = frame:WaitForChild("CheckBuild")

local closeBtn = frame:WaitForChild("CloseButton")

print("бульмени")

local fuelImage = frame:WaitForChild("Fuel")

local wheelImage = frame:WaitForChild("Wheel")

local engineImage = frame:WaitForChild("Engine")

print("бульмени")

local worldParts = {

Wheel = workspace.GAZAZEL:WaitForChild("Wheel"),

Engine = workspace.GAZAZEL:WaitForChild("Engine")

}

print("бульмени")

fuelImage.Visible = false

wheelImage.Visible = false

engineImage.Visible = false

worldParts.Wheel.Transparency = 1

worldParts.Engine.Transparency = 1

print("бульмени")

local parts = { Canister = false, Wheels = 0, Engine = false }

local function resetGui()

parts = { Canister = false, Wheels = 0, Engine = false }

statusLabel.Text = "Собери машину"

fuelImage.Visible = false

wheelImage.Visible = false

engineImage.Visible = false

worldParts.Wheel.Transparency = 1

worldParts.Engine.Transparency = 1

end

for _, btn in pairs({addCanister, addWheel, addEngine, checkBuild, closeBtn}) do

btn.Active = true

btn.Selectable = true

btn.Visible = true

end

addCanister.MouseButton1Click:Connect(function()

if parts.Canister then

statusLabel.Text = "Канистра уже добавлена."

return

end

local item = player.Backpack:FindFirstChild("GasCan") or player.Character:FindFirstChild("GasCan")

if item then

parts.Canister = true

fuelImage.Visible = true

statusLabel.Text = "✅ Канистра добавлена!"

else

statusLabel.Text = "❌ У тебя нет канистры!"

end

end)

addWheel.MouseButton1Click:Connect(function()

if parts.Wheels >= 2 then

statusLabel.Text = "Уже 2 колеса."

return

end

local item = player.Backpack:FindFirstChild("Wheel") or player.Character:FindFirstChild("Wheel")

if item then

parts.Wheels += 1

statusLabel.Text = ("✅ Колесо %d/2 добавлено"):format(parts.Wheels)

if parts.Wheels == 2 then

wheelImage.Visible = true

worldParts.Wheel.Transparency = 0

end

else

statusLabel.Text = "❌ У тебя нет колеса!"

end

end)

addEngine.MouseButton1Click:Connect(function()

if parts.Engine then

statusLabel.Text = "Двигатель уже добавлен."

return

end

local item = player.Backpack:FindFirstChild("Engine") or player.Character:FindFirstChild("Engine")

if item then

parts.Engine = true

engineImage.Visible = true

worldParts.Engine.Transparency = 0

statusLabel.Text = "✅ Двигатель добавлен!"

else

statusLabel.Text = "❌ У тебя нет двигателя!"

end

end)

checkBuild.MouseButton1Click:Connect(function()

if parts.Canister and parts.Wheels == 2 and parts.Engine then

statusLabel.Text = "🚗 Машина собрана!"

game.ReplicatedStorage.SpawnCar:FireServer()

resetGui()

gui.Enabled = false

else

statusLabel.Text = "⚠️ Машина ещё не готова!"

end

end)

closeBtn.MouseButton1Click:Connect(function()

gui.Enabled = false

end)

local prompt = workspace:WaitForChild("MachineStation"):WaitForChild("MachinePrompt")

prompt.Triggered:Connect(function(triggeringPlayer)

if triggeringPlayer == player then

gui.Enabled = true

statusLabel.Text = "Собери машину"

end

end)

По дате
По рейтингу
Аватар пользователя
Новичок

ничаво себе скриптик 0_0

Аватар пользователя
Новичок

пожалуйста если кто то может помочь помогите мне Роблокс студио код | Ответы Mail

Аватар пользователя
Ученик

он Local