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

Clone folder and text labels inside only works client side not server side. help?

Asked by 5 years ago

So this script is basically, when a player joins it should make a folder and clone 4 text labels into them. However when I play it, it only shows up on the players GUI. Does not show up on the server side.

-- Server Script
local players = game:GetService("Players")
local WPE = game.ReplicatedStorage.Client
local PF = game.ReplicatedStorage.Players

local function onPlayerAdded(player)
    local value = Instance.new("StringValue", PF)
    value.Name = player.Name
    WPE:FireClient()
end

game.Players.PlayerAdded:Connect(onPlayerAdded)

Local Script

local PF = game:GetService("ReplicatedStorage").Players
local AST = script.Parent.ForEveryone.Cater.ECT.Players.StatClone.AST
local PTS = script.Parent.ForEveryone.Cater.ECT.Players.StatClone.PTS
local REB = script.Parent.ForEveryone.Cater.ECT.Players.StatClone.REB
local NAME =    script.Parent.ForEveryone.Cater.ECT.Players.StatClone.NAME
local PlayerFrame = script.Parent.ForEveryone.Cater.ECT.Players

game.ReplicatedStorage.Client.OnClientEvent:Connect(function()
            if PF:FindFirstChildWhichIsA("StringValue") then
            local folderstats = Instance.new("Folder",PlayerFrame)
            folderstats.Name = game.Players.LocalPlayer.Name

            local NameClone = NAME:Clone()
            NameClone.Parent = folderstats
            NameClone.Text = game.Players.LocalPlayer.Name
            NameClone.Visible = true
            NameClone.TextScaled = true

            local AstClone = AST:Clone()
            AstClone.Parent = folderstats
            AstClone.Text = AstClone.Val.Value
            AstClone.Visible = true

            local PtsClone = PTS:Clone()
            PtsClone.Parent = folderstats
            PtsClone.Visible = true
            PtsClone.Text = PtsClone.Val.Value

            local RebClone = REB:Clone()
            RebClone.Parent = folderstats
            RebClone.Visible = true
            RebClone.Text = RebClone.Val.Value
    end
end)
0
your creating this locally bhqpping 80 — 5y
0
so what do I do xd xd WillBe_Stoped 71 — 5y
0
use a Script, not a LocalScript avozzo 22 — 5y
0
Your creating the folder on the LocalScript (client side) so ServerScripts (server sides) won't be able to find the folder. If you use a ServerScript to make the folder, all scripts will be able to find it awesomeipod 607 — 5y
0
The parent argument to Instance.new is deprecated, do not use it in new work. But in line 9 of the server script you need to specify the player for the server to fire to. User#19524 175 — 5y

Answer this question