Hi, how can I change this script so it gets the thumbnail and username from the player? I've tried a couple of times to change the coding but nothing seems to be working
local Part = script.Parent
local PlayerWin = game.StarterGui.PlayerWin
local PlayerName = game.StarterGui.PlayerWin.Frame.PlayerName
local PlayerImage = game.StarterGui.PlayerWin.Frame.ImageLabel
local thumbnail = Enum.ThumbnailType.HeadShot
Part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local Pic = hit.Parent.thumbnail
PlayerImage.Image = Pic
PlayerName.Text = hit.Parent.Name
PlayerWin.Enabled = true
Part:Destroy()
wait(10)
PlayerWin.Enabled = false
humanoid.Health = 0
end
end)

1 comment
hit.Parent is the character, not the player.