Hello!
I have a problem. Obvious, else I wouldn’t be here.
I would like to clone a Value that I have stored as a Child from the Script into the Player.
The code I’ve tried using is below:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local OxygenValue = script.OxygenLeft
OxygenValue:Clone().Parent = player
end)
I can’t tell what’s wrong with this? I’m not so advanced in ServerSide Scripting, so a quick look over and tell me what’s wrong would be amazing. The script is in ReplicatedStorage.
Like Xacima said, scripts placed within ReplicatedStorage don’t automatically run. If you want to create scripts that automatically run when the server starts, place them within ServerScriptService - thats what its designed for.
Usually you leave ReplicatedStorage as a sort of storage container for ModuleScripts, RemoteFunctions, and RemoteEvents.