I'm rather new to FE, but not to scripting. I'm not quite sure how this would work since mouse is client-side only..
LOCALSCRIPT
player = game.Players.LocalPlayer
repeat wait(.1) until player.Character
character = player.Character
mouse = player:GetMouse()
mouse.Button1Down:connect(function(hit)
game.Workspace.Events.Shoot:FireServer()
script.Parent.Parent.V3.Value = mouse.Hit.p
end)
SERVERSCRIPT
repeat wait(.1) until script.Parent.Parent.Parent.Name ~= "StarterPack"
player = game.Players:FindFirstChild(script.Parent.Parent.Parent.Parent.Name)
character = player.Character
--
center = player.Character.UpperTorso
Cooldowns = player.Backpack.Cooldowns
Limit = Cooldowns.Limit
Current = Cooldowns.Current
game.Workspace.Events.Shoot.OnServerEvent:connect(function()
if Cooldowns.Levitation.Value == 0 then
local make = Instance.new("Part")
make.Anchored = true
make.CanCollide = false
make.Transparency = 1
make.Parent = character
make.CFrame = player.Backpack.Vector3.Value --Basically here
make.Name = "Target"
if character.Ammo.Shot:FindFirstChild("Bullet") then
local bullets = character.Ammo.Shot:GetChildren()
for i=1,#bullets do
if character:FindFirstChild("Target") then
bullets[i].Propulsion.Target = character.Target
bullets[i].Propulsion.MaxThrust = 10000
bullets[i].Propulsion.TargetRadius = 25
bullets[i].Propulsion.ThrustD = 0
bullets[i].Anchored = false
bullets[i]:FindFirstChild("Force"):destroy()
bullets[i].Propulsion:Fire()
-- local touched = script.Touched:Clone()
-- touched.Parent = bullets[i]
-- touched.Disabled = false
coroutine.resume(coroutine.create(function()
bullets[i].Touched:connect(function(hit)
if hit.Name ~= workspace.Name then
if hit.Name ~= "Bullet" then
if hit.Name ~= "Explosion" then
if hit.Name == "Target" then
local Target = character:FindFirstChild("Target")
--
local smoke = Instance.new("Smoke")
local explode= Instance.new("Explosion")
smoke.Parent = character:FindFirstChild("Target")
explode.Parent = character:FindFirstChild("Target")
Target.Name = "Explosion"
bullets[i]:Destroy()
local val = 0
for i=1,20 do
val = val+0.05
if smoke ~= nil then
smoke.Opacity = 0.05*(val)
smoke.Size = 3
explode.BlastPressure = 5
explode.BlastRadius = 5
explode.DestroyJointRadiusPercent = 0
if smoke.Opacity == 1 then
smoke:Destroy()
end
end
end
--
else
--
local Target = character:FindFirstChild("Target")
--
local smoke = Instance.new("Smoke")
local explode= Instance.new("Explosion")
smoke.Parent = hit
explode.Parent = hit
Target.Name = "Explosion"
bullets[i]:Destroy()
local val = 0
for i=1,20 do
val = val+0.05
if smoke ~= nil then
smoke.Opacity = 0.05*(val)
smoke.Size = 3
if smoke.Opacity == 1 then
smoke:Destroy()
end
end
end
end
end
end
end
end)
end))
Cooldowns.Levitation.Value = 3
Current.Value = Current.Value-1
end
end
end
end
end)

1 comment
Alright, what lines exactly are these happening on? Why not just send the tuple argument of the Hit.p to the server through the RemoteEvent?