Turn a instance into a string or?
Asked by
4 years ago Edited 4 years ago
Hey, this is my first post and I'm just simply trying to learn why this line of code requires a string and if I can get it to take a variable/instance.
All I'm doing is trying to make a sign change to the player's name when touched.
I do understand that this code does have some stuff that could be shed off but I still can't find out why it wouldn't work.
The line of code I'm having trouble with is
"ourSign.Text = character"
My full code:
local sec15 = script.Parent
local platformg = false
local ourSign = game.Workspace.oursign.SurfaceGui.TextLabel
local function onTouch(partTouched)
1 | local character = partTouched.parent |
3 | local humanoid = character:FindFirstChildWhichIsA( "Humanoid" ) |
6 | if character and platformg = = false then |
7 | ourSign.Text = character |
end
--Event
sec15.Touched:Connect(onTouch)