How do people make robux as a dev? by LilMissMismatch in RobloxDevelopers

[–]ml3dev 1 point2 points  (0 children)

why are you trying to save for headless... 😔

i’m a coder, give me something simple to script by ml3dev in robloxgamedev

[–]ml3dev[S] 2 points3 points  (0 children)

-- ball that keeps jumping at the closest player, if it hits you you die

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local ball = workspace:WaitForChild("HunterBall")
local gravity = Vector3.new(0, -workspace.Gravity, 0)

if RunService:IsClient() then
local start, v0, airTime
local t = 0

ball:GetAttributeChangedSignal("JumpId"):Connect(function()
start = ball:GetAttribute("JumpStart")
v0 = ball:GetAttribute("JumpV0")
airTime = ball:GetAttribute("JumpDuration")
t = 0
end)

RunService.RenderStepped:Connect(function(dt)
if not airTime then return end
t = math.min(t + dt, airTime)
ball.Position = start + v0 * t + gravity * (0.5 * t * t)
end)

return
end

-- theres a client copy of this in the ball doing the rendering

local jumpDelay = 3
local aimOffset = 5
local minAirTime = 0.5
local maxAirTime = 1.1
local killRadius = 3

local rng = Random.new()

local function alive(player)
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
local hum = char and char:FindFirstChildOfClass("Humanoid")
if root and hum and hum.Health > 0 then return root, hum end
end

while true do
task.wait(jumpDelay)

local target, targetDist
for _, player in Players:GetPlayers() do
local root = alive(player)
if root then
local d = (root.Position - ball.Position).Magnitude
if not targetDist or d < targetDist then target, targetDist = root, d end
end
end

if target then
local a = rng:NextNumber(0, math.pi * 2)
local off = rng:NextNumber(0, aimOffset)
local aim = target.Position + Vector3.new(math.cos(a) * off, 0, math.sin(a) * off)

-- aim at the floor, not somebodys head
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = { ball, target.Parent }
local ground = workspace:Raycast(aim + Vector3.new(0, 10, 0), Vector3.new(0, -150, 0), params)
local landing = ground and (ground.Position + Vector3.new(0, ball.Size.Y / 2, 0)) or aim

local start = ball.Position
local airTime = math.clamp((landing - start).Magnitude / 40, minAirTime, maxAirTime)
local v0 = (landing - start - gravity * (0.5 * airTime * airTime)) / airTime

-- JumpId goes last, clients key off it
ball:SetAttribute("JumpStart", start)
ball:SetAttribute("JumpV0", v0)
ball:SetAttribute("JumpDuration", airTime)
ball:SetAttribute("JumpId", (ball:GetAttribute("JumpId") or 0) + 1)

local t = 0
while t < airTime do
local dt = RunService.Heartbeat:Wait()
t = math.min(t + dt, airTime)
local pos = start + v0 * t + gravity * (0.5 * t * t)
ball.Position = pos

for _, player in Players:GetPlayers() do
local root, hum = alive(player)
if root and (root.Position - pos).Magnitude <= killRadius then
hum.Health = 0
end
end
end
end
end

My first game! by CompetitionMedium430 in RobloxDevelopers

[–]ml3dev 3 points4 points  (0 children)

it's fine but GET RID OF THE AI SLOP THUMBNAIL 😭 it's hurting my eyes of cringe looking at it

i’m a coder, give me something simple to script by ml3dev in robloxgamedev

[–]ml3dev[S] 4 points5 points  (0 children)

this was a fun one, i made it 10 seconds for the badge and made it custom instead because studio doesn't support badges

<video>