I want to try and insert a dialog, and a sound into a player when they click a button. I'm not sure how to do this. This was my attempt (it doesn't work and I don't really understand the whole :GetPlayer stuff yet)
local button = script.Parent
local name = game.Players:GetFullName(game.Players:GetPlayerFromCharacter)
local dialog = game.ServerStorage.Dialog:Clone()
local talk = button.Talk:Clone()
button.ClickDetector.MouseClick:Connect(function()
local playerw = name
dialog.Parent = playerw.Head
talk.Parent = playerw.Head
playerw.Head.Talk.Playing = true
end)
Sorry for how messy it is, I was just lost. I really have no clue on this one.

6 comments
I know this is kind of a stupid question i just don't know how to do that
there's no real need to do that, u could just do this, function(andputhereanything, that's gonna be ur player)
wow BANSA168 so helpful totally understand that
Yeah i just found that out thanks so much.
I don't think this question deserves a downvote, he provided code, he just didn't know how to get the player
Also whoever gave that downvote should provide a reson next time