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

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

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

1 comment

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.

1 answer

✓ Accepted answer

Try LocalPlayer.Name

3 comments

0

Alr where do I replace it exactly??

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.

0

I did that however, when it displays the name it says the player locally for each player, how do I prevent that?

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