✓ Accepted answer
Tested your script. I think it's not working because LocalScripts don't run under dialogs. They only run under (from the wiki):
- Player Backpacks
- Player Characters
- StarterGui/PlayerGui
- PlayerScripts
- ReplicatedFirst
Or maybe DialogChoiceSelected doesn't work under local scripts but I think it's because of where you parent it.
This is actually easy to fix. Use a server (regular) script, and since DialogChoiceSelected returns the player, we can use that to find and kick the player.
Here's what your script should look like :
local Dialog = script.Parent
Dialog.DialogChoiceSelected:Connect(function(Player, Choice)
Player:Kick()
end)
Hope this helps!
4 comments
Show us your code. It gives us a better idea on how we can help you.
Is that in a localscript?
still doesn't not work
chat service