Code:
Script:
script.Parent.direF.OnServerEvent:Connect(function(pl, mouse)
local plr = pl
local char = plr.Character or plr.CharacterAdded:wait()
local hum = char.Humanoid
script.Parent.Parent.Parent.Data.Tries.Value = script.Parent.Parent.Parent.Data.Tries.Value + 50
script.Parent.Parent.Parent.Data.LeftMaina.Value = script.Parent.Parent.Parent.Data.LeftMaina.Value - 40
local AlreadyTouched = false
--local ray = Ray.new(char.HumanoidRootPart.CFrame.p, mouse.p)
local trident = game.ReplicatedStorage.Trident:Clone()
trident.BrickColor = BrickColor.new("Bright blue")
trident.Material = Enum.Material.Neon
trident.CanCollide = false
trident.CFrame = char.HumanoidRootPart.CFrame*CFrame.new(0,3,0)
trident.CFrame = CFrame.new(trident.CFrame.p,mouse.p)*CFrame.Angles(0,math.rad(180),0)
trident.Parent = char
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = mouse.p*1
BV.Parent = trident
end)
Local Script:
local Player = script.Parent.Parent.Parent
local mouse = Player:GetMouse()
local UIS = game:GetService("UserInputService")
local Debounce = false
local mouse = game.Players.LocalPlayer:GetMouse()
wait(4)
local remote = script.Parent.direF
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Player.Lipa.Wata.Value == 1 then
if Input.KeyCode == Enum.KeyCode.R then
if Debounce == true then return end
Debounce = true
if Player.Data.Level.Value >= 20 and Player.Pala.Kfar.Value >= 40 then
script.Parent.Parent.Parent.Pala.Kfar.Value = script.Parent.Parent.Parent.Pala.Kfar.Value - 30
for i = 1,3 do
remote:FireServer(mouse.Hit)
wait(2)
end
end
wait(1)
Debounce = false
end
end
end)
I cloned a union part and gave it a body velocity. The problem here is the tridents. They face the direction where my mouse is pointing but they go in a straight line different from where the mouse is.
This GIF shows me firing them at close range: https://gyazo.com/c9ca8b2993bcefca1524df45e186312a
Pretty slow and inaccurate right?
Now this GIF shows what happens when my mouse goes too far: https://gyazo.com/054f75930e6e2bf7dc90a8e00108023c
You can't even see the trident when I place it somewhere off the baseplate. That's how fast it goes.
Note: Even if I aim it into the sky you wouldn't be able to see the trident.

1 comment
Should be
mouse.Hit.LookVector * SPEED_VALUEon the velocity property, mouse.Hit.LookVector is the Unit Vector that you clicked your mouse at.