How do I make local parts visible globally without using remote events?

Essentially, there’s this old game that (with the permission of the owner) I’m trying to revamp and release. The problem is that it was made before FE was forced, so all the moves in the game were made locally.

The main issue here is that because they were made locally, they can also only be seen locally.

I’ve tried serializing the data and sending it over to the server, but it turned out that because of the way the moves are made, serialization is nigh-impossible.

Here’s an example of the code:

-------------------------------------------------Define Variables
hold=nil --used to notify the loop
player=game.Players.LocalPlayer
print(player.Name)
run=game:GetService("RunService")

chat=game:GetService("Chat")
enabled=true
---------------------------------------------------KeyDownFunction

function onButtonDown(mouse)
if not enabled then return end
enabled=false
if player.PlayerGui.HealthGui.Mana.Value < 40 then
	return end
hold=true
---CFrame Variables
LeftShoulder=player.Character.Torso["Left Shoulder"]
RightShoulder=player.Character.Torso["Right Shoulder"]
value1 = LeftShoulder.C0
value2 = RightShoulder.C0
Run = game:GetService("RunService")
---CFrame Variables End
bodypos = Instance.new("BodyPosition",player.Character.Torso)
bodypos.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bodypos.Position = player.Character.Torso.Position
bodygyro = Instance.new("BodyGyro",player.Character.Torso)
bodygyro.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
bodygyro.CFrame = CFrame.new(player.Character.Torso.Position,mouse.Hit.p)
bodygyro.P = 8500
player.Character.Humanoid.JumpPower = 0
------Create Fire Effect
f = script.Glow:clone()
f.Parent = player.Character.Head
f.CFrame = player.Character["Torso"].CFrame*CFrame.new(0,30,0)
m=Instance.new("Model",player.Character.Head)
m.Name = "PlanetaryBombRocks"
for i=1,10 do
r = script.Rocks:clone()
r.Parent = m
r.CFrame = player.Character["Torso"].CFrame*CFrame.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))* CFrame.Angles(1.5, math.random(1,360)/57.29582, math.random(1,360)/57.29582)
v = Instance.new("BodyPosition",r)
v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
v.Position = f.CFrame * Vector3.new(math.random(-3,3),math.random(-3,3),math.random(-3,3))
end
------Fire Effect End
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-1, 0, 0)
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-1, 0, 0)
player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 40
charge()
end

-----------------------Charge Function


function charge()
local size=0.1
local count=1
local damage=(90+(player.leaderstats1.Level.Value*2))
local mouse = player:GetMouse()
while hold==true and size<=3 and player.PlayerGui.HealthGui.Mana.Value > 0 do---Charging
wait(0.001)
player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 2
bodygyro.CFrame = CFrame.new(player.Character.Torso.Position,mouse.Hit.p)
damage=damage+3
size=size+0.05
r = script.Rocks:clone()
r.Parent = m
r.CFrame = player.Character["Torso"].CFrame*CFrame.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))* CFrame.Angles(1.5, math.random(1,360)/57.29582, math.random(1,360)/57.29582)
v = Instance.new("BodyPosition",r)
v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
v.Position = f.CFrame * Vector3.new(math.random(-size,size),math.random(-size,size),math.random(-size,size))
local dmgv=Instance.new("IntValue",r)
dmgv.Name="Amount_Dmg"
dmgv.Value=damage
local damage = script.Damage2:clone()
damage.Parent = r
owner = Instance.new("StringValue",damage)
owner.Value = player.Name
owner.Name = "Owner"
end
for u,c in pairs (m:GetChildren()) do
	if c:FindFirstChild("BodyPosition") then
		c:FindFirstChild("BodyPosition"):remove()
	end
	if c:FindFirstChild("Damage2") then
		c.Damage2:remove()
	end
end
f.CFrame = player.Character.Torso.CFrame
chat:Chat(player.Character.Head,"Planetary Bomb!",Enum.ChatColor.Green)
player.leaderstats1.XP.Value = player.leaderstats1.XP.Value + 25
f.CFrame = CFrame.new(f.Position,mouse.Hit.p)
for u,c in pairs (m:GetChildren()) do
if c.ClassName == "Part" then
game.Debris:AddItem(c,5)
c.CFrame = f.CFrame*CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
w = Instance.new("Weld",c)
w.Part0 = c
w.Part1 = f
w.C0 = CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))* CFrame.Angles(1.5, math.random(1,360)/57.29582, math.random(1,360)/57.29582)
end
end
local bv=Instance.new("BodyVelocity",f)
bv.maxForce=Vector3.new(math.huge,math.huge,math.huge)
bv.velocity=f.CFrame.lookVector*130
local dmgv=Instance.new("IntValue",f)
dmgv.Name="Amount_Dmg"
dmgv.Value=damage
local damage = script.Damage:clone()
damage.Parent = f
owner = Instance.new("StringValue",damage)
owner.Value = player.Name
owner.Name = "Owner"
damage.Disabled = false
f.Anchored = false

wait(3)
m:remove()
f:remove()
bodygyro:remove()
bodypos:remove()
player.Character.Humanoid.JumpPower = 50
RightShoulder.C0 = value2
LeftShoulder.C0 = value1
wait(5)
enabled=true
end
-----------------------------------------------ButtonUpfunction
function onButtonUp(mouse)
hold=false
end


function onSelected(mouse)
mouse.Button1Down:connect(function()onButtonDown(mouse)end)
mouse.Button1Up:connect(function()onButtonUp(mouse)end)
end
script.Parent.Selected:connect(onSelected)
------------------------------------------------------End

Why can’t you just make all these changes in a server script, and only fire a remote event on click, instead of sending one per each transformation?

Because there’s 100+ of attacks that I don’t feel like going through, piece by piece (they’re all coded differently. Not only that, but these scripts are descended under hopperbins, and for some reason, I can’t get global scripts to run under hopperbins.

I dont think there is an rady eay to approach this. Since each script has to be modified individually, and as you stated, there are hundreds.

Just make sure you make up your kind completely before making your choice.

If you dont really mind, i suppose you could switch out the HopperBins for tools. A plugin like Reclass might help.

I completely vouch with what @majdTRM says in his reply. The problem is not even that they are not visible on the server, they are not even made or replicated on the server in the first place. It would be way more difficult to make a system to replicate all of those changed CFrame’s and particles from the client to the server than just making it compatible with Filtering Enabled. Also giving that a lot of the systems in general can be using deprecated mechanics, so refining it would be the way to go.

1 Like

So there’s no real solution then?

There might be. But it would be very hacky, allows for exploits, and possibly annoying to work with in the future.

You dont have to necessarily pick my way, just make sure that since there are 100 of these, you choose the right approach. Maybe one where instead of storing different code for every tool, you could store the animations some other way?

Either way, this will be a lot of work, so good luck!

1 Like

Wait, do you mind explaining that way you were talking about? I’m not sure I’d have the energy to go through so many moves in the game.

how about showing me the code where you made the parts and particles and stuff?

They’re the children of the tool. Here’s a screenshot:
image

Ok, is it made by a script or is already in studio?

Already in the studio. The problem is that the attack clones them, and the cloned parts are local.

Sadly, I do not believe there is any other way to do this other than to use RemoteEvents or ServerScripts as client-side scripts will only be seen by the client

send me the script where the attack clones them

-------------------------------------------------Define Variables
hold=nil --used to notify the loop
player=script.Parent.Parent.Parent
run=game:GetService("RunService")

chat=game:GetService("Chat")
enabled=true
---------------------------------------------------KeyDownFunction

function onButtonDown(mouse)
if not enabled then return end
enabled=false
if player.PlayerGui.HealthGui.Mana.Value < 20 then
	return end
hold=true
---CFrame Variables
LeftShoulder=player.Character.Torso["Left Shoulder"]
RightShoulder=player.Character.Torso["Right Shoulder"]
value1 = LeftShoulder.C0
value2 = RightShoulder.C0
Run = game:GetService("RunService")
---CFrame Variables End
bodypos = Instance.new("BodyPosition",player.Character.Torso)
bodypos.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bodypos.Position = player.Character.Torso.Position
bodygyro = Instance.new("BodyGyro",player.Character.Torso)
bodygyro.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
bodygyro.CFrame = CFrame.new(player.Character.Torso.Position,mouse.Hit.p)
bodygyro.P = 8500
player.Character.Humanoid.JumpPower = 0
------Create Fire Effect
f = script.Glow:clone()
f.Parent = player.Character.Torso
f.CFrame = player.Character:FindFirstChild("Right Arm").CFrame*CFrame.new(0,-3,0)
w = Instance.new("ManualWeld",player.Character:FindFirstChild("Right Arm"))
w.Part0 = player.Character:FindFirstChild("Right Arm")
w.Part1 = f
w.C1 = CFrame.new(0,3,0)
f2 = script.Glow:clone()
f2.Parent = player.Character.Torso
f2.CFrame = player.Character:FindFirstChild("Left Arm").CFrame*CFrame.new(0,-3,0)
w = Instance.new("ManualWeld",player.Character:FindFirstChild("Left Arm"))
w.Part0 = player.Character:FindFirstChild("Left Arm")
w.Part1 = f2
w.C1 = CFrame.new(0,3,0)
------Fire Effect End
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-1, 0, 0)
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-1, 0, 0)
player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 20
charge()
end

-----------------------Charge Function



function charge()
local size=1
local rocksize=2
local count=1
local damage=(player.leaderstats1.Level.Value*2)
local mouse = player:GetMouse()
while hold==true and count<=20 and player.PlayerGui.HealthGui.Mana.Value > 0 do---Charging
wait(0.001)
player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 2
bodygyro.CFrame = CFrame.new(player.Character.Torso.Position,mouse.Hit.p)
damage=damage+2
count=count+0.5
size=size+0.1
rocksize=rocksize+0.2
end
chat:Chat(player.Character.Head,"Spacial Barrage!",Enum.ChatColor.Green)
player.leaderstats1.XP.Value = player.leaderstats1.XP.Value + 25
for i=1,count do
bodygyro.CFrame = CFrame.new(player.Character.Torso.Position,mouse.Hit.p)
m = math.random(1,2)
x = f:clone()
x.Parent = player.Character.Torso
x.Size = Vector3.new(rocksize,rocksize,rocksize)
if m==1 then
x.CFrame = f.CFrame
elseif m==2 then
x.CFrame = f2.CFrame
end
x.CFrame = CFrame.new(x.Position,mouse.Hit.p)
local bv=Instance.new("BodyVelocity",x)
bv.maxForce=Vector3.new(math.huge,math.huge,math.huge)
bv.velocity=x.CFrame.lookVector*130
local dmgv=Instance.new("IntValue",x)
dmgv.Name="Amount_Dmg"
dmgv.Value=damage
local damage = script.Damage:clone()
damage.Parent = x
owner = Instance.new("StringValue",damage)
owner.Value = player.Name
owner.Name = "Owner"
damage.Disabled = false
game.Debris:AddItem(x,3)
wait(0.4)
end
f:remove()
f2:remove()

wait(3)
bodygyro:remove()
bodypos:remove()
player.Character.Humanoid.JumpPower = 50
RightShoulder.C0 = value2
LeftShoulder.C0 = value1
wait(5)
enabled=true
end
-----------------------------------------------ButtonUpfunction
function onButtonUp(mouse)
hold=false
end


function onSelected(mouse)
mouse.Button1Down:connect(function()onButtonDown(mouse)end)
mouse.Button1Up:connect(function()onButtonUp(mouse)end)
end
script.Parent.Selected:connect(onSelected)
------------------------------------------------------End

can you fix the indentation a bit? It’s really hard to read. But I can kind of see a solution now. Please fix the indentation.

Not sure there’s a viable way to do this. These parts literally do not exist server-side, and will need to be made to exist on the server-side.

You will likely need to create a function for each move in a server-side script, then using a remoteEvent, pass the player’s character as a parameter to that function, and then execute the function on the server-side instead. Shouldn’t take an obnoxiously long time per move.

Why is this? I find it hard to imagine something like this is impossible.

What’s the solution? I’m still having trouble with this.

The game is made in a way where there’s a bunch of different objects in different places, and there’s too many to keep track of and serialize.