If its possible how can i do it?
I tried doing FireServer(mouse.Hit.p), but there was an error in the serverscript when i wrote it. Any help on how to do this?
LocalScript :
UIS.InputBegan:Connect(function(Input, gameProcessedEvent) local KeyCode = Input.KeyCode if gameProcessedEvent == false then if KeyCode == Enum.KeyCode.F and chain == 0 and script.Parent.Combat.active.Value == false then chain = 1 print("1 fired") local animTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(LeftKBlast) animTrack:Play() workspace.CurrentCamera.Sounds.P2:Play() Event:FireServer(mouse.Hit.p)
ServerScript :
Event.OnServerEvent:Connect(function(player, mouse.Hit.p) local x = Instance.new("Part") x.BrickColor = BrickColor.new("Institutional white") x.Shape = "Ball" x.Material = "Neon" x.Size = Vector3.new(1.7,1.7,1.7) x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.CanCollide = false x.Transparency = 0 x.Name = "Blast" local xx = Instance.new("Part") xx.BrickColor = BrickColor.new("Toothpaste") xx.Shape = "Ball" xx.Material = "Neon" xx.Size = Vector3.new(2,2,2) xx.TopSurface = "Smooth" xx.BottomSurface = "Smooth" xx.CanCollide = false xx.Transparency = .1 xx.Name = "Blast2" x.CFrame = game.Players.LocalPlayer.Character:FindFirstChild("RightHand").CFrame*CFrame.new(0,0,0) xx.CFrame = game.Players.LocalPlayer.Character:FindFirstChild("RightHand").CFrame*CFrame.new(0,0,0) local pos1 = mouse.Hit.p local direction1 = (pos1 - x.Position).unit y = Instance.new("BodyVelocity") y.maxForce = Vector3.new(math.huge, math.huge, math.huge) y.Velocity = direction1 * 200 x.Parent = game.Workspace xx.Parent = game.Workspace y.Parent = x local pos = mouse.Hit.p local direction = (pos - xx.Position).unit local yy = Instance.new("BodyVelocity") yy.maxForce = Vector3.new(math.huge, math.huge, math.huge) yy.Velocity = direction * 200 yy.Parent = xx end)
You need a RemoteFunction A RemoteFunction allows you to return stuff to whatever script called the RemoteFunction A RemoteEvent is the same but you can't return stuff.
RemoteFunction:InvokeServer(Mouse.Hit.p)