Hello to the developers
I would like to ask you for help in roblox studio, for some reason scripts do not work for me and it does not show the digital order, but before it was. I don’t know what the reason is, maybe you can help solve it.
Here is a screenshot.
I don’t know why this has happened, ill look into it.
However, I see that you have set the leaderstats to an IntValue?
I would change that to a folder, if I were you.
Ill keep looking into the problem though
You are setting
score.Parent = 0
remove this line as this is not what you want as you can’t set the parent of an intvalue to a number.
Are you also closing the function? You haven’t sent a complete picture of the script.
Be sure to end the function with end
function onPlayerEntered(newplayer)
wait()
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local score = Instance.new("IntValue")
score.Name = "Cash"
score.Value = 0
score.Parent = newPlayer
end
I assume you want the score to be shown in the leaderstats. If so, you would have to write your code like this:
function onPlayerEntered(newplayer)
wait()
local stats = Instance.new("Folder", newplayer) --we parent this folder to the player
stats.Name = "leaderstats"
local score = Instance.new("IntValue", stats) --we parent the intValue to the stats folder
score.Name = "Cash"
score.Value = 0
end
This weird unicode character gets inserted if you press SHIFT and ENTER at the same time.
See:
This is a known bug that happens when pressing shift + enter in the script editor. If you attempt to run your script you will get an error like this:
Unexpected Unicode character: U+2028. Did you mean ’ '?
To fix your issue you could try copying your code and then pasting it back into the script editor window.
That, at all scripts are not written to me. there is no digital order, I wrote other scripts as well, they don’t work either, I don’t know what to do, either remove the roblox permanently or reinstall the roblox studio.
It’s most likely U+2028, I was able to somewhat replicate your issue
Just remove the line separators by copying the code (Ctrl
+ a
) into another script,