Okay!
You could’ve continued this in your original post but hey ho here we are.
Please do some research on the roblox wiki it is a great place to start!
TweenInfo - link
TweenService - link
I’ve adjusted your script to include a time variable as the first parameter in tweeninfo, and a easingstyle of sine.
local previousSpawnPoint
local orb = game.ServerStorage.Orb
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new()
while true do
task.wait(15 * 60) -- Waits 15 minutes
local chosenSpawn = spawnLocations:GetChildren[math.random(1, #spawnLocations:GetChildren())]
if previousSpawn ~= nil and previousSpawn == chosenSpawn then
chosenSpawn = spawnLocations:GetChildren[math.random(1, #spawnLocations:GetChildren())]
until chosenSpawn ~= previousSpawn
end
previousSpawn = chosenSpawn
local orbClone = orb:Clone
orbClone.Parent = workspace
orbClone.Position = chosenSpawn.Position + Vector3.new(0, chosenSpawn.Position.Y + 20, 0)
tweenService:Create(orbClone, tweenInfo, {
Position = chosenSpawn.Position}):Play()
end
Now to tackle the second thing,
5 minutes is 5*60 (5 minutes) etc idk how to explain im horrible!
One way to accomplish this is to use our handy dandy touched event.
I have once again edited your script to do this for you.
``lua
local previousSpawnPoint
local orb = game.ServerStorage.Orb
local tweenService = game:GetService(“TweenService”)
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine)
local previousSpawn = nil
local spawnLocations = nil --// if the variable exists remove else set this to your spawnpoints
while true do
task.wait(15 * 60) – Waits 15 minutes
local chosenSpawn = spawnLocations:GetChildren()[math.random(1, #spawnLocations:GetChildren())]
if previousSpawn ~= nil and previousSpawn == chosenSpawn then
repeat task.wait()
chosenSpawn = spawnLocations:GetChildren()[math.random(1, #spawnLocations:GetChildren())]
until chosenSpawn ~= previousSpawn
previousSpawn = chosenSpawn
local orbClone = orb:Clone()
orbClone.Parent = workspace
orbClone.Position = chosenSpawn.Position + Vector3.new(0, chosenSpawn.Position.Y + 20, 0)
tweenService:Create(orbClone, tweenInfo, {Position = chosenSpawn.Position}):Play()
local orbCollected = false
local start = tick()
local hitConn
hitConn = orbClone.Touched:Connect(function(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
--// award badge if you want
orbCollected = true
hitConn:Disconnect()
end
end
end)
repeat task.wait() until orbCollected or (tick() - start) >= 5*60
if hitConn then
hitConn:Disconnect()
end
hitConn = nil
tweenService:Create(orbClone, tweenInfo, {Transparency = 1}):Play()
game.Debris:AddItem(orbClone, tweenInfo.Time + .5)
end
end
i myself have not played tsb before but this script should be more then enough than you need to help you.
Also here’s the link to badgeservice!