Prompt.Triggered doesn't work

And put the remote event inside replicated storage

Didn’t work. @LambHubGoBrrrrr I’ll try your method.

can you add a print in here?

Prompt.Triggered:Connect(function(plr)
-- here
    RemoteEvent:FireClient(plr)
end)

There is no chance that it doesn’t fire when inside the proximity prompt.

its the same if it was inside ServerScriptService or inside the ProximityPrompt.

I also said putting the remote event inside the replicated storage…

Bumping my reply. Have you tried this yet?

Again didn’t work…
Local Script:

-- Services
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- Player
local Player = Players.LocalPlayer
local Char = Player.CharacterAdded:Wait() or Player.Character

-- Passport Dialogue Frame
local PassportDialogueFrame = script.Parent.PassportDialogue

-- Passport Dialogue Buttons
local PassportDialogueButtons = {PassportDialogueFrame.AcceptButton, PassportDialogueFrame.DeclineButton}

-- Click Sound
local ClickSound = script.Parent.ClickSound

-- Select Sound
local SelectSound = script.Parent.SelectSound

-- OnTrigger
local RemoteEvent = ReplicatedStorage.RemoteEvents.OnPassportGiverTrigger

-- Tool
local Tool = script.Parent.Passport

local Question = "Would you like to get a passport?"
local Say2 = "Here you go..."
local Say3 = "Okay, bye..."
local QuestionLabel = PassportDialogueFrame.Question

RemoteEvent.OnClientEvent:Connect(function()
    PassportDialogueFrame.Visible = true

    for i = 1, #Question do
        QuestionLabel.Text = string.sub(Question, 1, i)
    end
    repeat wait() until QuestionLabel.Text == Question
    PassportDialogueFrame.AcceptButton.Visible = true
    PassportDialogueFrame.DeclineButton.Visible = true
end)

PassportDialogueFrame.AcceptButton.MouseButton1Click:Connect(function()
    if Player.Backpack:FindFirstChild("Passport") or Char:FindFirstChild("Passport") then
        return
    else
        local NewTool = Tool:Clone()
        NewTool.Parent = Player.Backpack
        for i = 1, #Question do
            QuestionLabel.Text = string.sub(Say3, 1, i)
        end
    end

    repeat wait() until QuestionLabel.Text == Say2
    PassportDialogueFrame.Visible = false
    PassportDialogueFrame.AcceptButton.Visible = false
    PassportDialogueFrame.DeclineButton.Visible = false
end)

PassportDialogueFrame.DeclineButton.MouseButton1Click:Connect(function()
    for i = 1, #Question do
        QuestionLabel.Text = string.sub(Say3, 1, i)
    end
    repeat wait() until QuestionLabel.Text == Say3
    PassportDialogueFrame.Visible = false
    PassportDialogueFrame.AcceptButton.Visible = false
    PassportDialogueFrame.DeclineButton.Visible = false
end)

for _,Button in ipairs(PassportDialogueButtons) do
    if not Button:IsA("TextButton") then continue end
    local UICorner = Button:WaitForChild("UICorner")
    local Square = TweenService:Create(UICorner,TweenInfo.new(0.1),{CornerRadius = UDim.new(0.05,0)})
    local Circle = TweenService:Create(UICorner,TweenInfo.new(0.1),{CornerRadius = UDim.new(0.5,0)})
    Circle:Play()
    Button.MouseEnter:Connect(function()
        if SelectSound.SoundId ~= nil then
            SelectSound:Play()
        end
        Button.UIStroke.Enabled = true
        Square:Play()
    end)
    Button.MouseLeave:Connect(function()
        Button.UIStroke.Enabled = false
        Circle:Play()
    end)
    Button.MouseButton1Click:Connect(function()
        if ClickSound.SoundId ~= nil then
            ClickSound:Play()
        end
    end)
end

Server Script:

-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- Prompt 
local Prompt = script.Parent

-- OnTrigger
local RemoteEvent = ReplicatedStorage.RemoteEvents.OnPassportGiverTrigger

Prompt.Triggered:Connect(function(plr)
    RemoteEvent:FireClient(plr)
end)

try to add a print inside the Triggered Function to see if its firing.

Also inside the local script. If it does print then its not the prompts problem.

image
image

Alright, the problem is in the script you wrote not in the prompt

And what is the problem in my local script? @LambHubGoBrrrrr

The for loop doesn’t work as well. So I think it is because of the whole local script.

Your script stopped here, the order of conditional statement is also important

Since CharacterAdded:Wait() comes first, if the character already exists
It will still wait because this come first, before or Player.Character

Simply swap it around

1 Like

Thanks so much. It worked. But I have one more problem.


This doesn’t work. I mean that the buttons are becoming instantly visible and the text is instantly there.

can you give a bit more detail?

I need the typewriter effect done and then the buttons will appear.

There is a new property in BaseGui with texts quite a while now, that provides what you needed, try that instead
Typewriter Effect: New property MaxVisibleGraphemes (Live) - Updates / Announcements - DevForum | Roblox