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)

5 comments

0

your creating this locally

0

so what do I do xd xd

0

use a Script, not a LocalScript

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

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.