Как сделать в роблокс студио, чтобы написанный текст в textbutton менялся на табличке? - Роблокс

Вопрос Как сделать в роблокс студио, чтобы написанный текст в textbutton менялся на табличке?

Регистрация
27 Дек 2013
Сообщения
98
Репутация
1
Спасибо
0
Монет
0
я хочу сделать табличку в роблоксе, на которой можно будет писать в любых режимах, добавив ее в каталог. скрипт написан хорошо, но текст не сохраняется и не меняется, ни в текст буттоне, ни на табличке, может вы найдете ошибку? внизу прикрепляю скрипт
local sign = script.Parent
local currentText = "роблокс студио"
local gui = Instance.new("SurfaceGui")
gui.Face = Enum.NormalId.Front
gui.Adornee = sign
gui.CanvasSize = Vector2.new(500, 300)
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(0.9, 0, 0.8, 0)
textLabel.Position = UDim2.new(0.05, 0, 0.1, 0)
textLabel.BackgroundTransparency = 1
textLabel.Text = currentText
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextScaled = true
textLabel.Font = Enum.Font.SourceSansBold
textLabel.TextWrapped = true
textLabel.Parent = gui
gui.Parent = sign
local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Изменить текст"
prompt.ObjectText = "Табличка"
prompt.HoldDuration = 0
prompt.MaxActivationDistance = 10
prompt.Parent = sign
prompt.Triggered:Connect(function(player)
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "EditSignGui"
screenGui.Parent = player.PlayerGui
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 400, 0, 250)
frame.Position = UDim2.new(0.5, -200, 0.5, -125)
frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
frame.BorderSizePixel = 0
frame.Parent = screenGui
local title = Instance.new("TextLabel")
title.Text = "Изменить текст таблички"
title.Size = UDim2.new(1, 0, 0, 30)
title.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
title.TextColor3 = Color3.new(1, 1, 1)
title.Font = Enum.Font.SourceSansBold
title.Parent = frame
local textBox = Instance.new("TextBox")
textBox.Size = UDim2.new(0.9, 0, 0, 100)
textBox.Position = UDim2.new(0.05, 0, 0.2, 0)
textBox.Text = currentText
textBox.PlaceholderText = "Введите текст..."
textBox.ClearTextOnFocus = false
textBox.MultiLine = true
textBox.TextWrapped = true
textBox.TextScaled = true
textBox.BackgroundColor3 = Color3.new(1, 1, 1)
textBox.TextColor3 = Color3.new(0, 0, 0)
textBox.Parent = frame
local saveBtn = Instance.new("TextButton")
saveBtn.Text = "Сохранить"
saveBtn.Size = UDim2.new(0.4, 0, 0, 40)
saveBtn.Position = UDim2.new(0.05, 0, 0.7, 0)
saveBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 0)
saveBtn.TextColor3 = Color3.new(1, 1, 1)
saveBtn.Font = Enum.Font.SourceSansBold
saveBtn.Parent = frame
local closeBtn = Instance.new("TextButton")
closeBtn.Text = "Закрыть"
closeBtn.Size = UDim2.new(0.4, 0, 0, 40)
closeBtn.Position = UDim2.new(0.55, 0, 0.7, 0)
closeBtn.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
closeBtn.TextColor3 = Color3.new(1, 1, 1)
closeBtn.Font = Enum.Font.SourceSansBold
closeBtn.Parent = frame
saveBtn.MouseButton1Click:Connect(function()
local newText = textBox.Text
if newText ~= "" and #newText <= 200 then
currentText = newText
textLabel.Text = newText
screenGui:Destroy()
else
textBox.Text = "Слишком длинный текст! (макс. 200 символов)"
task.wait(1)
textBox.Text = newText
end
end)
closeBtn.MouseButton1Click:Connect(function()
screenGui:Destroy()
end)
end)
 
Регистрация
26 Сен 2013
Сообщения
87
Репутация
0
Спасибо
0
Монет
0
Почему бы не попробовать поискать ответ где-то ещё? Здесь только неразбериха, а там порядок, анонимность и абсолютно новые возможности!
 
Сверху Снизу