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

I'm trying to get it so when the player steps on the platform it displays their name any help?

So, I'm following a course because my parents said if you follow the course you can get a tutor. So I've followed this lesson. But I want to change the text label when you step on the platform the players name with show but it's not working. Here's the script:

--Varibles
local Platform = script.Parent
local PlatformGuard = false
local mySign = game.Workspace.SurfaceGui.TextLabel

local function OnTouched(partTouched)
	local character = partTouched.Parent
	local humanoid = character:FindFirstChildWhichIsA("Humanoid")
	
if  PlatformGuard then = false then
		mySign.Text = player.Name
		PlatformGuard = true
	end
end

Now's there's an error on line 11 on the equal sign if PlatformGuard = false then it's saying add a expected identifer but I'm confused to add one because I did not think the script would need one.

Thank you for reading any help will be apecciated.

2 comments

0

if PlatformGuard == false then is the correct line (line10)

0

It saids unknown global player

1 answer

Easy fix, you just wrote it a little bit wrong.

--Varibles
local Platform = script.Parent
local PlatformGuard = false
local mySign = game.Workspace.SurfaceGui.TextLabel
 
local function OnTouched(partTouched)
    local character = partTouched.Parent
    local humanoid = character:FindFirstChildWhichIsA("Humanoid")
 
	if PlatformGuard == false then
		mySign.Text = player.Name
		PlatformGuard = true
	end
end

1 comment

0

You need double equal signs, not just a single one.

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