I’ve recently been trying to fix the old ROBLOX slingshots, but because of FE, I’m having to use remote events to send information from the client to the server.
The problem is, that for some reason the RemoteEvent only fires sometimes and sometimes doesn’t fire at all. The way that the slingshot makes projectiles is by cloning a “Bullet” from ReplicatedStorage from the client and then shooting it toward the mouse. I haven’t made any remotes to send that information to the server because I’m not really sure how to.
I’ve tried different ways to fire the RemoteEvent and I’ve tried cloning the “Bullet” from the server but nothing seems to be working when I play test and check the server side.
missile.Touched:Connect(function(hit)
if hit.Parent.Name == vPlayer then
hit.Parent.Humanoid:TakeDamage(0)
elseif hit.Parent then
game.ReplicatedStorage.Hit:FireServer(function(hit)
hit.Parent.Humanoid:TakeDamage(120)
end)
hit.Parent.Humanoid:TakeDamage(120)
missile.BillboardGui.Hit.Visible = true
wait(1.5)
missile:Destroy()
end
end)
this is the code that’s supposed to deal damage when the Bulelt hits another player from the client side, and I tried referencing the Hit RemoteEvent.
Tool.Enabled = true
function OnActivated(targetOverride)
wait(0)
if not Tool.Enabled then
return
end
local character = Tool.Parent;
local humanoid = character:FindFirstChild('Humanoid')
if humanoid == nil or humanoid.Health <= 0 then
print("Humanoid not found, or not alive")
return
end
Tool.Enabled = false
local targetPos = targetOverride or MyMouse.Hit.p
Fire(targetPos)
if PelletCopy then PelletCopy.Transparency = 1 end
Tool.Enabled = true
end
this is the code that checks if the tool is activated, I haven’t done anything to this part.