modifique esse script para funcionar com um proximitypromt ao inves do click no…
- User
modifique esse script para funcionar com um proximitypromt ao inves do click no imagebutton ; -- LocalScript -- Serviços local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local TweenService = game:GetService("TweenService") -- Adicionado o TweenService
-- Variáveis local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") -- Humanoid do jogador local playerGui = player:WaitForChild("PlayerGui")
-- Partes no Workspace local escreverPart = workspace:WaitForChild("escrever") local lousaPart = workspace:WaitForChild("Lousa")
-- GUI "Texto" local textoGui = playerGui:WaitForChild("Texto") textoGui.Enabled = false -- Certifique-se de que está desabilitado inicialmente
-- Botão na BillboardGui da parte "escrever" local escreverBillboardGui = escreverPart:WaitForChild("SurfaceGui") local abrirButton = escreverBillboardGui:WaitForChild("ImageButton") -- Botão para abrir a GUI "Texto"
-- Elementos dentro da GUI "Texto" local frame = textoGui:WaitForChild("Frame") local canvasGroup = frame:WaitForChild("CanvasGroup") local textBox = canvasGroup:WaitForChild("TextBox") local enviarButton = frame:WaitForChild("Enviar") -- Botão "Enviar" dentro da GUI "Texto", que é um ImageButton local fecharButton = frame:WaitForChild("Fechar") -- Botão "Fechar" dentro da GUI "Texto"
-- RemoteEvent local sendTextEvent = ReplicatedStorage:WaitForChild("SendText")
-- Função para desabilitar o pulo e o movimento local function disablePlayerControls() humanoid.WalkSpeed = 0 -- Desabilita movimento humanoid.JumpHeight = 0 end
-- Função para habilitar o pulo e o movimento local function enablePlayerControls() humanoid.WalkSpeed = 16 -- Habilita movimento humanoid.JumpHeight = 8.359 end
-- Função para abrir a GUI "Texto" quando o botão é clicado abrirButton.MouseButton1Click:Connect(function() textoGui.Enabled = true canvasGroup.GroupTransparency = 1 -- Começa totalmente transparente
codedisablePlayerControls() -- Desabilita pulo e movimento -- Animação de fade in (aparecer) local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local tween = TweenService:Create(canvasGroup, tweenInfo, {GroupTransparency = 0}) tween:Play()end)
-- Função para fechar a GUI "Texto" ao clicar no botão "Fechar" fecharButton.MouseButton1Click:Connect(function() -- Animação de fade out (desaparecer) local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local tween = TweenService:Create(canvasGroup, tweenInfo, {GroupTransparency = 1}) tween:Play()
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.