I want to make a script that when a player join it’ll put a folder in them with value, but being a small brain i cant figure it out right.
if you can help it’ll be greatly appreciated!
-also feel free to ask questions in comments
I want to make a script that when a player join it’ll put a folder in them with value, but being a small brain i cant figure it out right.
if you can help it’ll be greatly appreciated!
-also feel free to ask questions in comments
game.Players.PlayerAdded:Connect(function(plr) --player connected
local folder = Instance.new("Folder") --created a new folder
--[ editing the folder]
folder.Name = ""
folder.Parent = plr
--[ creating a value ]
local value = Instance.new("ValueNameHere")
value.Parent = folder
end)
would a datastore be able to save these values? like if i want to save the values would i b able to use a datastore to save them?
Almost anything can be stored as data - therefore, you can save them values.
game:GetService("Players").PlayerAdded:Connect(function(p)
local folder = Instance.new("Folder", p)
local Value = Instance.new("IntValue", folder)
Value.Value = 0 -- you can change it
end
Put it in ServerScriptService as Script
for sum reason the value wont show up in the values folder
You’d need to specify the type of value in local value = Instance.new("ValueNameHere")
, alongside, it must be a Script in ServerScriptService - don’t forget to name your folder.
game.Players.PlayerAdded:Connect(function(player)
local folder = Instance.new("Folder")
folder.Name = "Name Here"
folder.Parent = player
local value = Instance.new("StringValue") --it can be any value tho
value.Name = "Value"
value.Parent = folder
end)
thank you lol, also thanks to everyone who tried helping