local Projectile = script.Projectile
local ProxProm = script.Parent.ProximityPrompt
local VehicleSeat = script.Parent.Parent.VehicleSeat
local canshoot = true
local function FIRE()
Projectile.Effects.Enabled = true
local c = Projectile:Clone()
c.Name = "Bomb"
c.Parent = workspace
c.Velocity = (c.CFrame.LookVector * 250)
c.Effects:Destroy()
c.Touched:Connect(function(hit)
if not hit:IsDescendantOf(script.Parent.Parent) then
local explosion = Instance.new("Explosion",workspace)
explosion.Position = c.Position
c:Destroy()
end
end)
wait(0.5)
Projectile.Effects.Enabled = false
wait(4)
ProxProm.Enabled = true
end
local db = false
local CanJoint = VehicleSeat.Cannon
local Cannon = script.Parent
local RE = game.ReplicatedStorage.PositionCannon
ProxProm.Triggered:Connect(function(plr)
if VehicleSeat.Occupant ~= nil and VehicleSeat.F.Force == Vector3.new(0,0,0) and canshoot == true then
RE:FireClient(game.Players:GetPlayerFromCharacter(VehicleSeat.Occupant.Parent))
Projectile.BrickColor = BrickColor.new("Really red")
RE.OnServerEvent:Connect(function(plr,pos)
if VehicleSeat.Occupant.Parent.Name == plr.Name then
Projectile.BrickColor = BrickColor.new("Really black")
CanJoint.C1 = CFrame.lookAt(CanJoint.C1.Position,pos):Inverse()
FIRE()
end
end)
end
end)
VehicleSeat.F.Changed:Connect(function()
if VehicleSeat.F.Force ~= Vector3.new(0,0,0) then
ProxProm.Enabled = false
else
ProxProm.Enabled = true
end
end)
my code does not position the cannon upwards or downwards aka on the Z axis it only does on Y axis
First of all, you are the one requesting someone to take their time to help you out. It is unprofessional to call one “rude” for not responding to your topic. Your behavior also discourages others to help you.
Second, your post is lacking detail. All you gave us is a copy and paste of a script, and a single sentence. You need to add videos, detailed descriptions, etc., and other things that would be helpful to solve the issue you are having.
ok so clearly the remote event fires to the client which returns a variable “pos” which is the mouse.hit.p CanJoint is a join in my vehicle seat that holds the cannon and positions it
Now it explains a whole lot more. So, seems like the cannon isn’t going up/down (aka Y Axis). Pretty interesting, but I don’t see any problems with the script. And also, I do see people struggling with the Y axis of their code, so I really don’t blame you. I’ll try to get a working code (+Explanation).