So I’m trying to make a gun with FastCast: Redux but when I’m debug bc. of lots of errors that comes up:
Client Script: short
Tool.Activated:Connect(function()
local Origin = FirePoint.Position
local Direction = (Mouse.Hit.Position - Origin).Unit
ReplicatedStorage.Events.GunCast:FireServer(Player, Vector3.new(Origin.X, Origin.Y, Origin.Z), Vector3.new(Direction.X, Direction.Y, Direction.Z), 900, 1000, 20)
end)
Server Script: looong
local function GunCast(Player, Origin, Direction, Velocity, Range, Damage)
local FastCastRay = FastCastRedux.new()
local FastCastParams = RaycastParams.new()
local FastCastBehavior = FastCastRedux.newBehavior()
FastCastBehavior.MaxDistance = Range
FastCastBehavior.RaycastParams = FastCastParams
FastCastBehavior.AutoIgnoreContainer = false
FastCastBehavior.CosmeticBulletContainer = workspace.BulletFolder
FastCastBehavior.CosmeticBulletTemplate = BulletTemplate
FastCastParams.FilterType = Enum.RaycastFilterType.Blacklist
FastCastParams.FilterDescendantsInstances = {Player.Character, workspace.BulletFolder}
print(Origin, Direction)
--FastCastRay:Fire(Origin, Direction, Velocity, FastCastBehavior)
FastCastRay.LengthChanged:Connect(FastCastOnLengthChange)
FastCastRay.RayHit:Connect(FastCastOnHit, Damage)
end
Thanks!