Trying to fix a value GUI (Name changing for it)

Hello, so I am trying to make this guy just change value, and not add value, for example, changing the name to demon, this is my script under here!

Function.OnServerInvoke = function(Player, Username, Race)
print(Username, Race)
game.Players:FindFirstChild(Username).Race.Value = game.Players:FindFirstChild(Username).Race.Value
print(Player.Name … " changed " … Race … " " …game.Players:FindFirstChild(Username).Race.Value … " to " … Username)
end

It isn’t working for some reason, if someone could help me out a little it’d be very much appreciated, please point out the mistake, or correct me here please, it’s meant to change the players value inside of players though.

1 Like

you used “…” (Three dots), only you can use “. .” (Two dots)

Function.OnServerInvoke = function(Player, Username, Race)
     print(Username, Race)
     game.Players:FindFirstChild(Username).Race.Value = game.Players:FindFirstChild(Username).Race.Value
     print(Player.Name ..  " changed " ..  tostring(Race) .. " " .. tostring(game.Players:FindFirstChild(Username).Race.Value) .. " to " .. Username)
end

here :arrow_up:

1 Like

why two dots changing to three dots

1 Like

I’m bad at scripting, that’s my only answer, but yeah I’ll try.

1 Like

new code:

Function.OnServerInvoke = function(Player, Username, Race)
     print(Username, Race)
     Player.Race.Value = Race
     print(Player.Name ..  " changed " ..  tostring(Race) .. " " .. tostring(game.Players:FindFirstChild(Username).Race.Value) .. " to " .. Username)
end
2 Likes

i see you changing value player Race = new Race

1 Like

Oh wait, let me try that, cause first time it didn’t really work.
image

1 Like

Okay, so now the GUI ain’t really working, and this comes up.

1 Like

Actually, I’ll try that, since that is on Line 15

1 Like

can i see line 15? (30 30 30 30 karakter)

1 Like

Sure.

And here is the full script also, cause why not.

local Allowed = {[1130831331] = true, [0] = true} – your User Id(s)
local ServerStorage = game:GetService(“ServerStorage”)

game.Players.PlayerAdded:Connect(function(Player)
if Allowed[Player.UserId] then
local UI = ServerStorage:FindFirstChild("!@#$%"):Clone()
UI.Parent = Player.PlayerGui
end
end)

local Function = game:GetService(“ReplicatedStorage”):FindFirstChild("^&*")

Function.OnServerInvoke = function(Player, Username, Race)
print(Username, Race)
Player.Race.Value = Race
print(Player.Name … " changed " … tostring(Race) … " " … tostring(game.Players:FindFirstChild(Username).Race.Value) … " to " … Username)
end

1 Like

now, Player.Race is String value right? (string = “this message in string”) and Race is string? isnt string make it string, use tostring(number)
(what means tostring? like this : to-string)

1 Like

I don’t fully know, I was asking my friend earlier for a bit of help, but that didn’t really work out, since he told me to use tostring and not string or anything.

1 Like

hmm, now answer this question : whats Race value Classname? (lookup in Property)

1 Like

can you uh… make it a bit readable? write “```”

like this
1 Like

StringValue, that’s what it is.

1 Like

I don’t really know how to do that, but I could try, but don’t know if it’s gonna work.

”local Allowed = {[1130831331] = true, [0] = true} – your User Id(s)
local ServerStorage = game:GetService(“ServerStorage”)

game.Players.PlayerAdded:Connect(function(Player)
if Allowed[Player.UserId] then
local UI = ServerStorage:FindFirstChild("!@#$%"):Clone()
UI.Parent = Player.PlayerGui
end
end)

local Function = game:GetService(“ReplicatedStorage”):FindFirstChild("^&*")

Function.OnServerInvoke = function(Player, Username, Race)
print(Username, Race)
Player.Race.Value = Race
print(Player.Name … " changed " … tostring(Race) … " " … tostring(game.Players:FindFirstChild(Username).Race.Value) … " to " … Username)
end”

Nope didn’t work.

1 Like

well write ``` that three uh i forgot what its called

1 Like

Oh I see.

local ServerStorage = game:GetService("ServerStorage")

game.Players.PlayerAdded:Connect(function(Player)
	if Allowed[Player.UserId] then
		local UI = ServerStorage:FindFirstChild("!@#$%"):Clone()
		UI.Parent = Player.PlayerGui
	end
end)

local Function = game:GetService("ReplicatedStorage"):FindFirstChild("^&*")

Function.OnServerInvoke = function(Player, Username, Race)
	print(Username, Race)
	Player.Race.Value = Race
	print(Player.Name ..  " changed " ..  tostring(Race) .. " " .. tostring(game.Players:FindFirstChild(Username).Race.Value) .. " to " .. Username)
end”
1 Like

can i see player variables (Players > You)

1 Like