My LocalScript is supposed to change a player's name upon clicking a textbutton, but it doesn't do anything and has no output errors.
Let's say the player's username is BobtheRandomUsername12345. The script is supposed to change his displayed name to BobtheRandomUsername12345: Testing if he clicks the button.
script.Parent.MouseButton1Click:connect(function(enter)
if enter then
v = game.Players.LocalPlayer
for a, mod in pairs(v.Character:children()) do
if mod:findFirstChild("NameTag") then
v.Character.Head.Transparency = 0 mod:Destroy()
end
end
local char = v.Character
local nam = (v.Name .." : Testing")
local mod = Instance.new("Model", char)
mod.Name = nam
local cl = char.Head:Clone()
cl.Parent = mod
local hum = Instance.new("Humanoid", mod)
hum.Name = "NameTag"
hum.MaxHealth = 0
hum.Health = 0
local weld = Instance.new("Weld", cl) weld.Part0 = cl weld.Part1 = char.Head
char.Head.Transparency = 1
end
end)
Does know why this doesn't work and can tell me how to fix it? Thanks!
