Today I just discovered that a new player can't build but then when they leave and rejoin they can build. I tested my game on a new alt account and that's when I figured it didn't work. Can someone test it or tell me if games don't work as well with new alt accounts? My game link is here if you want to see the problem https://www.roblox.com/games/4568812624/new-pets-Apocalypse-Simulator

Tycoon Handler



local rs = game:GetService("ReplicatedStorage")


if rs:FindFirstChild(script.Parent.Name) then 
else
	local base = script.Parent:Clone()
	base.Parent = rs
end

local orefolder = Instance.new("Folder", workspace)
orefolder.Name = script.Parent.Name.."Ores"
script.Parent.OreFolderName.Value = orefolder.Name

script.Parent.Floor.Touched:Connect(function(hit)
	if hit:FindFirstChild("DropValue") then
		hit:Destroy()
	end
end)

Player added script


local rs = game:GetService("ReplicatedStorage")

game.Players.PlayerAdded:Connect(function(plr)
	local ls = Instance.new("IntValue", plr)
	ls.Name = "leaderstats"
	local rc = Instance.new("NumberValue", plr)
	rc.Name = "RealMoney"
	local c = Instance.new("StringValue", ls)
	c.Name = "Money"
	c.Value = "$"..rc.Value
	c.Value = 10
	rc.Value = 10
	
	

	
	if workspace.Bases.Blue.Owner.Value == "" then
		workspace.Bases.Blue.Owner.Value = plr.Name
	elseif workspace.Bases.Red.Owner.Value == "" then
		workspace.Bases.Red.Owner.Value = plr.Name
	elseif workspace.Bases.Yellow.Owner.Value == "" then
		workspace.Bases.Yellow.Owner.Value = plr.Name
	elseif workspace.Bases.Green.Owner.Value == "" then
		workspace.Bases.Green.Owner.Value = plr.Name
	end
	
	rc.Changed:Connect(function()
		wait(.1)
		c.Value = "$"..rc.Value
	end)
end)



game.Players.PlayerRemoving:Connect(function(plr)
	for i,v in pairs(workspace.Bases:GetChildren()) do
		if v.Owner.Value == plr.Name then
			local clonedbase = rs[v.Name]:Clone()
			workspace[v.OreFolderName.Value]:Destroy()
			v:Destroy()
			clonedbase.Parent = workspace.Bases
		end
	end
end)


event handler

local RS = game:GetService("ReplicatedStorage")
local Items = RS.Items
local Place = RS.Place
local Sell = RS.Sell
local Move = RS.Move

Place.OnServerEvent:Connect(function(plr,Item,X,Y,Z,Rotation,price,PlrTycoon,Replacing)
	local item = Items[Item]:Clone()
	item.Parent = workspace.Bases[PlrTycoon].Placed
	item.PrimaryPart = item.Hitbox
	item:SetPrimaryPartCFrame(CFrame.new(X,Y,Z) * CFrame.Angles(0,math.rad(Rotation),0))
	local hitbox = item.PrimaryPart:Clone()
	hitbox.Parent = workspace.Bases[PlrTycoon].Placed.Hitboxes
	item.HitboxObj.Value = hitbox
	
	if not Replacing then
		local plrmoney = plr:WaitForChild("RealMoney")
		plrmoney.Value = plrmoney.Value - price
	end
end)

Sell.OnServerEvent:Connect(function(plr,Item,PlrTycoon)
	if Item.Parent == workspace.Bases[PlrTycoon].Placed then
		plr.RealMoney.Value = plr.RealMoney.Value + math.floor(Item.PriceVal.Value/2)
		local hitbox = Item.HitboxObj.Value
		hitbox:Destroy()
		Item:Destroy()
	end
end)

Move.OnServerEvent:Connect(function(plr,Item,PlayerTycoon)
	local hitbox = Item.HitboxObj.Value
	hitbox:Destroy()
	Item:Destroy()
end)

Main Script

repeat wait(.1) until game.Players.LocalPlayer
local Player = game.Players.LocalPlayer
local RealMoney = Player:WaitForChild("RealMoney")
local Money = Player:WaitForChild("leaderstats").Money





local MoneyGui = script.Parent:WaitForChild("MoneyGui").MoneyGui.Money

MoneyGui.Text = Money.Value
Money.Changed:Connect(function()
	wait(.1)
	MoneyGui.Text = Money.Value

end)

4 comments

0

Is there any scripts to to the issue? If yes send it in.

0

Please include code so we can help you.

0

ok

0

Updated