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

A player name to display of who sent the nuke, a script error is displayed instead. Any solutions?

Asked by
xp5u 25
2 years ago
local local_plr = game:GetService("Players").LocalPlayer
game.ReplicatedStorage.GUI.OnClientEvent:Connect(function()
    script.Parent.TextTransparency = 0
    script.Parent.Text = local_plr
    wait(0.1)
    script.Parent.Text = (local_plr .. "H")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HA")
    wait(0.1)

    script.Parent.Text = (local_plr .. "HAS")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS S")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SE")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SEN")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT O")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OU")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A N")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A NU")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A NUK")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A NUKE")
    wait(0.1)
    script.Parent.Text = (local_plr .. "HAS SENT OUT A NUKE!")

        wait(3)
        script.Parent.Text = ""


end)

script error is here: Players.xp5u.PlayerGui.Announcement.Nuke alert.LocalScript:4: invalid argument #3 (string expected, got Instance) - Client - LocalScript:4

It is a localscript in startergui

0
This doesn't have anything to do with this question but since its already answered you should try using https://devforum.roblox.com/t/typewriter-effect-new-property-maxvisiblegraphemes-live/1092043 instead of repetitive updates. co_existance 141 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Try LocalPlayer.Name

0
Alr where do I replace it exactly?? xp5u 25 — 2y
0
At line 4 change local_plr to local_plr.Name, If the error occurs on other lines after that, put .Name after that too. Bankrovers 226 — 2y
0
I did that however, when it displays the name it says the player locally for each player, how do I prevent that? xp5u 25 — 2y
Ad

Answer this question