local String = game.ReplicatedStorage.StValue -- StValue is my StringValue Game.Players.PlayerAdded:Connect(Funcation() -- I want to add 1 evrey time a player Joined String.Value = String.Value + "1" -- Am I doing anything Wrong here? end)
Am getting this Message in the out put
ServerScriptService.Script:9: attempt to perform arithmetic (add) on Instance and string
Use an Integer Value instead of a String, String Values are for text. But if you want it to add 1 to the text do this:
local String = game.ReplicatedStorage.StValue Game.Players.PlayerAdded:Connect(function() String.Value = String.Value.."1" end)
If you want to convert an IntValue into a StringValue do this:
local Integer = game.ReplicatedStorage.IntValue Game.Players.PlayerAdded:Connect(function() Integer.Value = Integer.Value + 1 local string = tostring(Integer.Value) end)
Oh that is easy:
local str = "Hello" str = str.."1" print(str)
Hey, I see a misspelling here! Correction:
Game.Players.PlayerAdded:Connect(function() --In this part, you want to have a NumberValue with you. Number.Value = Number.Value + 1 String.Value = Number.Value end)
Test this out and let me know if it works! (No bad comments, please.)