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

how do i kick player when selecting dialog choice?(my english is so bad sry)

Asked by 2 years ago

local Dialog = game.Workspace.Gojo.Head.Dialog.DialogChoice.beforeoof.oof

Dialog.DialogChoiceSelected:Connect(function(Player, Choice)

Player:Kick()

end)

im getting error ;/

DialogChoiceSelected is not a valid member of DialogChoice "Workspace.Gojo.Head.Dialog.DialogChoice.beforeoof.oof" - Server - Script:3

1 answer

Log in to vote
0
Answered by
NGC4637 602 Moderation Voter
2 years ago
Edited 2 years ago

first of all, put your code in a code block :v

second, DialogChoiceSelected is an event for Dialogs, not DialogChoices.

game.Workspace.Gojo.Head.Dialog.DialogChoice.beforeoof.oof is a DialogChoice, game.Workspace.Gojo.Head.Dialog is the Dialog.

so, do this:

local Dialog = workspace.Gojo.Head.Dialog -- yes, you can just do workspace instead of game.Workspace but only for workspace.

Dialog.DialogChoiceSelected:Connect(function(plr, choice)
    if choice == Dialog.DialogChoice.beforeoof.oof then
        plr:Kick("insert kick message here")
    end
end)
Ad

Answer this question