hello, im currently making a script that activates when a player click on a proximity prompt.
but the script doesn’t work as i intended
so how the script works is when a player presses “E” on their keyboard a GUI will show up and texts will show up like a typewriter and player will have to press “Enter” to continue the dialog and move to the next one.
heres what i did to the scripts :
a local script i put inside the screen gui
local input = game:GetService(“UserInputService”)
local enter = script.Parent
local module = require(game.ReplicatedFirst.Convo_Random)
local conversation = game.Workspace.lol.Sign.Interact.ProximityPrompt.RandomConversation
local function Text()
module:Textmessage()
end
if wait(conversation)then
input.InputBegan:Connect(function(input,hi)
if hi then
return
end
if input.KeyCode == Enum.KeyCode.Return then
Text()
end
end)
end
a module script i put inside a Replicated First
local module = {}
local Dialog_Text = game.StarterGui.Dialog.DialogFrame.Text
local function Textmessage()
Dialog_Text.Text = “Test 1 2 3”
end
return module
another local script i put inside a proximity point (game.workspace.lol.Sign.Interact.ProximityPrompt.RandomConversation)
also, i believe the issue may be in the script in the Proximity Prompt. You’re changing the visibility of the GUI in startergui rather than playergui. try this:
--Define basic variables
local player = game:GetService("Players").LocalPlayer
local gui = player.PlayerGui
--Set gui to not enabled
gui.Enabled = false
--triggers function to enable GUI
script.Parent.Triggered:Connect(function()
gui.Enabled = true
end)
--Start function
script.Parent.Triggered:Connect(function(player) --ties argument with the player
--Define Basic Variable(s)
local gui = player.PlayerGui.Dialog
--Starts actual function part
gui.Enabled = true
end)