Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[solved]why is ray not casting while aiming?

Asked by
Klui36 45
1 year ago
Edited 1 year ago

So, basically im making a sniper game, but i have one big problem. if i dont aim everything seems like normal and the serversided fastcast script works perfectly fine. But if im aiming, the caster doesnt Fire but the remoteevent is working. Any help and ideas are appreciated.

Please note that i am using a scope GUI to represent aiming.

Client:

01local mousePos = mouse.Hit.Position
02            local Table = {}
03            for i, v in pairs(game.ReplicatedStorage.Instances.VModel.Value:GetDescendants()) do
04                table.insert(Table, v)
05            end
06            game.ReplicatedStorage.Events.FireEvent:FireServer(framework.viewmodel.FirePart.Position, mousePos, framework.module.velocity, Table)
07            framework.module.ammo -= 1
08 
09            repeat
10                wait()
11            until IsAiming == false
12 
13            if framework.module.ammo ~= 0 then
14                IsBolting = true
15                game.ReplicatedStorage.Events.BoltEvent:FireServer()
View all 25 lines...

Server:

01game.ReplicatedStorage.Events.FireEvent.OnServerEvent:Connect(function(Traveledplayer, firePartPos, mousePos, velocity, ITable)
02    if Traveledplayer.Character then
03        print("fired")
04        local sound = Traveledplayer.Character.UpperTorso:FindFirstChild("Fire")
05        pos = firePartPos
06 
07        Player = Traveledplayer
08 
09        castParams.FilterType = Enum.RaycastFilterType.Blacklist
10        for i, v in pairs(Traveledplayer.Character:GetDescendants()) do
11            table.insert(ITable, v)
12        end
13        castParams.FilterDescendantsInstances = ITable
14        castParams.IgnoreWater = true
15 
View all 29 lines...
0
i forgot to Targetfilter the gun. Klui36 45 — 1y

Answer this question