Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Text doesn't appear when a button is clicked?

So i want text to appear when someone clicks. It should display this: "[name of the player who clicked] asks you to open the gate." But instead it shows only the "asks you to open the gate" part. Help?

My most recent attempt: (it is a normal script)

local sign = script.Parent.Parent.P_cel.SurfaceGui.TextLabel
local cd = script.Parent.ClickDetector

cd.MouseClick:Connect(function(plr)
	sign.Text = plr.Name and "asks you to open the gate.
end)

What went wrong? And, it doesn't display any errors.

1 answer

✓ Accepted answer
local sign = script.Parent.Parent.P_cel.SurfaceGui.TextLabel
local cd = script.Parent.ClickDetector

cd.MouseClick:Connect(function(plr)
    sign.Text = plr.Name.."asks you to open the gate."
end)

Hi so to connect strings u need to do this "Plr name".."This is a diffrent string"

This discussion is preserved as it was. New answers, comments, and votes are closed.