How could I get the Player from a character with a humanoid? Here’s the script I have trying to get the player:
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent.Humanoid
if humanoid then
local player = humanoid.Player
player.PlayerGui.DemoEnd.Frame.Script.Enabled = true
game.Workspace.Fade:Play()
end
end)```
The correct search inputs which you should input into google search to get the correct solution should be getting player from a touched event as touched event is the main source on information.