Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Server script not running Upon cloning?

Asked by 4 years ago
Edited 4 years ago

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

0
Where is the script located? RhysRocksRules 38 — 4y
0
Before its cloned Replicated storage IAMSEAHAWK 0 — 4y
0
could you show the cloning script? raid6n 2196 — 4y
0
i edited the main post IAMSEAHAWK 0 — 4y

1 answer

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

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)
Ad

Answer this question