Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Server script not running Upon cloning?

Hello i have a folder with 2 int values, upon each player joining it is cloned to there game.Players.PlayerName but the problem is this script doesn't run at all how would one fix this

this is the code in my script below

local parent = script.Parent
local exp = parent.Exp
local level = parent.Level

local function LevelUpLogic(value)
	print(value)
end
exp.Changed:Connect(LevelUpLogic)

here is the cloning script

local players = game.Players

local function CloneStats(playerName)
	local Plystats = game.ReplicatedStorage.PlayerStats:Clone()
	Plystats.Parent = playerName
end

local player = game.Players.PlayerAdded:Connect(CloneStats)


I have tried a few different methods to fix this such as changing how it is cloned or cloning it separate but nothing has worked so far

4 comments

0

Where is the script located?

0

Before its cloned Replicated storage

0

could you show the cloning script?

0

i edited the main post

1 answer

make the cloning script:

local players = game.Players

local function CloneStats(playerName)
    local Plystats = game.ReplicatedStorage.PlayerStats:Clone()
    Plystats.Parent = playerName
end
players.PlayerAdded:Connect(function(player)
CloneStats(player)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.