Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
Using the Roblox Luau language, how would I make a script that finds the nearest…
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
Using the Roblox Luau language, how would I make a script that finds the nearest character to me, then teleports me to that character? Make a separate function for getting the nearest character and then incorporate it into the main code.
- Assistant
Here is the code for finding the nearest character:
codefunction findNearestCharacter() local characters = game.Workspace:GetChildren() local myPos = game.Players.LocalPlayer.Character.PrimaryPart.Position local nearestCharacter = nil local nearestDistance = math.huge for i, character in pairs(characters) do if character:IsA("Model") and character ~= game.Players.LocalPlayer.Character then local distance = (character.PrimaryPart.Position - myPos).Magnitude if distance < nearestDistance then nearestCharacter = character nearestDistance = distance end end end return nearestCharacter endAnd here is the main code that uses the
findNearestCharacterfunction to teleport the player to the nearest character:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →