Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to make this script fire items so other players can see?

Asked by 6 months ago

This script is local, only the local player can see. I know that a remote event can help other players see. I don't know how due to the velocity of the part. Do I make a new part in the server and add the body velocity there and send the coordinates or is there an easier way? I cannot figure it out.

Here is the PART of the local script, this is the main function and this is activated when the tool connects:

function mouseDownFunction()
    local Debounce = false
----------------------------------------------------------------------------------
    local clone = ship:Clone()
    clone.Parent = game.Workspace
    clone.Name = player.Character.Name.."Part"
    clone.Position = character.Position + Vector3.new(5,0,0)
----------------------------------------------------------------------------------  
    local bv = Instance.new("BodyVelocity")
    bv.Parent = clone 
    bv.MaxForce = Vector3.new(1e8,1e8,1e8) 
    local mousePos = mouse.Hit.p - Vector3.new(5,0,0)
    bv.Velocity = (mousePos - character.Position).unit * speed--(mouse.hit.p - character.Position).unit * speed
----------------------------------------------------------------------------------
    local sparkes = Instance.new("ParticleEmitter", clone)
    sparkes.Size = NumberSequence.new(5)
    clone.CanCollide = false    
------------------------------------------------------------------------------      
    clone.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") and Debounce == false then 
            if hit.Parent ~= player.Character.Name then
                hit.Parent.Humanoid:TakeDamage(damage)
                clone:Destroy()
            end
        end
    end)    
end

Thanks for the Help!

0
You'll need to create the projectile on the server, yes. Ziffixture 5655 — 6mo
0
there are multiple videos on youtube that show how to do this Oblivious_Blitz 1 — 6mo

Answer this question