Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Dialogue script is not working when tested?

Asked by 3 years ago

I put a normal script into a dialogue choice so when a player clicks on it they get a keycard. Why didn't it work?

local rep = game:GetService("ReplicatedStorage")
local key = rep:FindFirstChild("Keycard")

local player = game.Players.LocalPlayer


workspace.Dialog.DialogChoiceSelected:connect(function(player,choice)
    if choice.Name == "Keycard please!" then
        key:Clone().Parent = player
    end
end)

Answer this question