When the character touches a brick a GUI becomes visible.
I tried the GetPlayerFromCharacter method but the output is 22:05:01.018 - GetPlayerFromCharacter is not a valid member of Model 22:05:01.019 - Script 'Workspace.Part.Script', Line 4 22:05:01.021 - Stack End**
Here is the code
function onTouch(brick)
local p = brick.Parent:findFirstChild("Humanoid")
if p ~= nil then
p.Parent:GetPlayerFromCharacter()
end
end
script.Parent.Touched:connect(onTouch)

3 comments
It won't allow me to access things like PlayerGui. How would I do this?
If you got player using the above script, then playergui would be a child of the player for example print(player.PlayerGui.Name) would just print the name of playerGui, which is "PlayaerGui"
Edited