ADVERTISEMENTREMOVE ADS
shoot from anywhere
30,839 views
Description
this script will allow you to set a point on the court ( cframe) and then when you click the button to shoot i will shoot from where you set that point no matter where you are and green it
ADVERTISEMENTREMOVE ADS
47 Lines • 1.39 KiB
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local shootRemote = ReplicatedStorage.Client.Remotes.Gameplay.Shoot
local perfectFill = 99.81245458126068
local direction = "Down"
local thirdArg = false
local savedCFrame = nil
local shootEnabled = true
local keys = {
setCFrame = Enum.KeyCode.Y,
shoot = Enum.KeyCode.E
}
--[[
How to use:
Move to the spot you want to shoot from.
Press the "setCFrame" key (default Y) to save your position.
Press the "shoot" key (default E) to shoot with perfect fill from the saved position.
]]
local function saveCFrame()
local char = player.Character
if char and char:FindFirstChild("HumanoidRootPart") then
savedCFrame = char.HumanoidRootPart.CFrame
print("CFrame saved:", savedCFrame.Position)
else
print("No character found to save CFrame.")
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == keys.setCFrame then
saveCFrame()
elseif input.KeyCode == keys.shoot and shootEnabled and savedCFrame then
pcall(function()
shootRemote:InvokeServer(perfectFill, direction, thirdArg, savedCFrame)
end)
end
end)
ADVERTISEMENTREMOVE ADS
ADVERTISEMENTREMOVE ADS
Comments
Does it still make a green