Hi, I am trying to make a model that puts the username of any player that touches a brick into a surface gui. I am having difficulty with the username and have tried different options such as the getplayerfromcharacter. Below is the code I have so far. Any help is appreciated.
local character = game.Workspace.Player
local player = game.Players:GetPlayerFromCharacter(character)
screen = workspace.Screen.SurfaceGui.Frame.TextBox
Sens = script.Parent
local function OnTouch (Sens)
screen.Text = ("Person Reset:" ..player.Name)
end
Sens.Touched:Connect (OnTouch)

1 comment
There is no "Player" under workspace. Best way to find the player is by using the Touched event.