0

# [ SOLVED ] Why is my RP Name changer not saving?

Edited 1 month ago

Hello there, thank you for reading. I am making a game where you can name your character and it saves, but the code won't save the name for some reason. It used to work, I got it from a Youtuber, and I have messed around with it, but it's still not working. It will change the player's "name," which is basically just changing a Billboard GUI's text above the player's head, but it won't save it.

Script in ServerScriptService:

local textServ = game:GetService("TextService")
local DataStore = game:GetService("DataStoreService")
local NameStore = DataStore:GetDataStore("RPNames")

local rpData = Instance.new("Folder")
rpData.Name = "RPData"

local rpName = Instance.new("StringValue")
rpName.Name = "RPName"
rpName.Value = NameStore:GetAsync(plr.UserId) or ""
rpName.Parent = rpData

rpData.Parent = plr

wait(0.2)

if over then

local text = over.TextLabel

if(plr.RPData.RPName.Value ~= "") then

text.Text = plr.RPData.RPName.Value

else
text.Text = plr.Name
end
end
end
end)

plr.RPData.RPName.Changed:Connect(function()

if over then

local text = over.TextLabel

text.Text = plr.RPData.RPName.Value

end

end
end)
end)

game.ReplicatedStorage.ChangeRPName.OnServerEvent:Connect(function(plr, name)

local filteredObject
local filteredText

local success, err = pcall(function()
filteredObject = textServ:FilterStringAsync(name, plr.UserId)
end)

if(success) then
local complete, failed = pcall(function()
end)

if(complete) then

if over then

local text = over.TextLabel

text.Text = filteredText
NameStore:SetAsync(plr.UserId, filteredText)
end
end
end
end
end)


I do have the RemoteEvent and the BillboardGUI in ReplicatedStorage, and they are both correctly named. There are no errors in the Output and it is printing "HEAD" when the code finds the player's head. Thank you!