Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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.

0
if PlatformGuard == false then is the correct line (line10) Nguyenlegiahung 1091 — 4y
0
It saids unknown global player charlesec 36 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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
0
You need double equal signs, not just a single one. ParticularlyPenguin 71 — 4y
Ad

Answer this question