--make a cosine projectile that hits a player
--make a variable for the player
local plr = game.Players.LocalPlayer
--make a variable for the mouse
local m = plr:GetMouse()
--make a function that makes the projectile
function makeProjectile()
--create a part and set it's properties
local projectile = Instance.new("Part")
projectile.Parent = workspace
projectile.Size = Vector3.new(1,1,1)
projectile.Position = plr.Character.HumanoidRootPart.Position + Vector3.new(0,5,0)
--create a mesh and set it's properties
local mesh = Instance.new("SpecialMesh")
mesh.Parent = projectile
mesh.MeshType = Enum.MeshType.Sphere
--set up some variables to use later on in the script (these are local variables so they can't be accessed outside of this function)
local velocityVector --this is where we will store our velocity vector (the direction and speed at which our projectile moves)
local gravityVector --this is where we will store our gravity vector (the direction and speed at which our projectile falls down due to gravity)
--connect an event that runs every frame while the player holds down their left mouse button. This event will run 60 times per second.
m.InputChanged:Connect(function(inputObject)
if inputObject.UserInputState == Enum.UserInputState.Begin then --if the user starts holding down their left mouse button...
if inputObject.KeyCode == Enum.KeyCode.MouseButton1 then --...check if they are pressing their left mouse button...
while inputObject.UserInputState ~= Enum.UserInputState.End do --...while they are still holding down their left mouse button...
wait() --wait until next frame before running code again. This way we don't have to wait 1/60th of a second between each line of code.
inputObject.Changed:Wait() --wait until something changes about this Input Object before continuing with code. This way we don't have to check if UserInputState has changed every single frame.
velocityVector = CFrame.lookAt(projectile.Position,m.Hit.p).lookVector * 100 --calculate what direction and how fast our projectile should move based on where your cursor is pointing when you click your left mouse button.
print(velocityVector)
repeat wait() until not pcall(function() return m.Target end) or m.Target.Name ~= "Terrain" or m
Alright, So I finished my prompt (this is my prompt that I used for example) -- Make a part that explodes when a player touches it and then I press enter then tab? I also have print('Hello World!") before the prompt. So does that affect anything or no?
I think what you need to do is make the prompt, press enter, let the AI generate the code and then press tab, as you would do with github copilot, it is still an early beta for this feature and for now copilot is a better tool if you are able to access it anyway
Because they are trying to use a Roblox Beta Feature, not an external tool. They aren’t asking for help with ChatGPT, they just want to figure out how to use the now built-in tool in Roblox Studio
First of all, ChatGPT is an out dated AI model that doesn’t really know the new API like overlap queries and raycast, and then you have that it takes an account in order to use it which many people might not be willing to create just for making kind of bad code for their roblox games.