So i made a gun that shoots bananas but i want them to do damage when they hit a player. I have already tried just making a simple damage script in the banana its self but it doesnt work? Any ideas?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local banana1 = ReplicatedStorage.banana
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Damage = 10
script.Parent.Activated:Connect(function()
local banana = banana1:Clone()
banana.CFrame = script.Parent.Handle.CFrame
local cow = Instance.new("BodyVelocity",banana)
cow.P = Vector3.new(100,100,100)
cow.Velocity = mouse.Hit.LookVector * 100
banana.Parent = game.Workspace
wait(2)
game.Workspace.banana:Destroy()
end)

1 comment
guess i will try use remote events then