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