Hello i would like some help figuring out how i can implement this choosing players ui just like this in hide and seek extreme
i have put a video down below
I tried finding some tutorials and i couldn’t find any i tried to look in devforums to see if anyone had done this before
its not really the best drawing but i think you would understand what i mean
i would also like to add that it would start off fast and then slow. I think tweening would work
If you can can you please explain to me how it works or a youtube video! thx
make a list, then make all the ui’s link to a index of that list, fill that list with all the players’ thumbnails, then increment the list indexes and stuff like that, example:
local imgIndexes = {
profileImg1,
profileImg2,
etc..
}
local imgFold = script.Parent[image folder here] --every img label used for the random rolling should be in this variable!
for i,v in imgFold:GetChildren() do
v:SetAttribute("tableImgIndx",i)
end
function addPlayersToList ()
list.clear()
for i,v in game.Players:GetChildren() do
if v:IsA("Player") then
table.insert(imgIndexes,[add player thumbnail here])
end
end
end
function startSpin ()
for i=1,math.random(20,40) do
task.spawn(function()
for i,v in imgFold:GetChildren() do
local oldVal = v:GetAttribute("tableImgIndx")
v:SetAttribute("tableImgIndx",oldVal += 1)
if not imgIndexes[v:GetAttribute("tableImgIndx")] then
v:SetAttribute("tableImgIndx",0)
end
v.ImageId = imgIndexes[v:GetAttribute("tableImgIndx")]
end
end)
wait(0.1)
end
end
That was for five players or ten players. It has the potential to be a generic animation effect for more than just players. At that stage, it was incomplete.
I have a nice looking spin selector, just adding a few finishing touches. The thing is, this needs to be secure, so that adds to the project considerations. Also, if I am going to create something, I will definitely make it generic, meaning it can spin and pick from anything.
In your case, without a script to go off, how will you be getting the five players to pick from?
It’s nice to post a script along with your question to we can see your direction.
alright so it gets a set amount of killers within a set amount in another module script but
-- section for choosing the killer --
local Killertable = {}
local playing = {}
module.PlayingPlayers = function()
local CCC = 0
for i, item in pairs(playing) do
CCC += 1
end
return CCC
end
module.killeramount = function()
local CCC = 0
for i, item in pairs(Killertable) do
CCC += 1
end
return CCC
end
module.RemoveSpecificPlayer = function(player)
if table.find(playing, player.Name) then
table.remove(playing,player.Name)
end
if table.find(Killertable,player.Name) then
table.remove(Killertable, player.Name)
end
end
module.GetTaggedPlaying = function()
for i, child in pairs(game.Players:GetChildren()) do
if child.Config.Playing.Value == true then
table.insert(playing, child.Name)
end
end
end
game.Players.PlayerRemoving:Connect(function(player)
module.RemoveSpecificPlayer(player)
end)
module.SetNewMathSeed = function()
math.randomseed(tick() * tick() + 2)
end
module.ChooseKiller = function(killeramount)
Killertable = {}
module.SetNewMathSeed()
local function ChooseKillers()
local playersPlaying = module.PlayingPlayers()
local Randomise = math.random(1, #playersPlaying)
local chosenkiller = game.Players:GetChildren()[Randomise]
print("chosen killer is " .. chosenkiller.Name)
table.insert(Killertable,chosenkiller.Name)
end
for i=0,killeramount do
ChooseKillers()
end
return module.killeramount()
end
in short this script makes a new math seed to create new randomisation and gets the players who have playing to true because theres a afk mode in my game so yeah. Then it gets every player and adds them to the table. Then killer is chosen.
module.ClassicGameMode = function(data_table) -- for gamemode only. No map generation lol
task.wait(0.5)
-- 1 killer 11 survivors. survive!
module.SetNewMathSeed()
-- assuming the map has been loaded ( module.Start is already loaded the map for the specific gamemode)
local MapSpawnPoints = game.Workspace.Map:GetChildren()[1].SpawnPoints
-- checks until there is a certain amount of players
repeat
task.wait(0.01)
print("not enough players")
until module.RequestAmountOfUsersInGame() >= data_table.minimum_players
-- add players to playing bracket
module.GetTaggedPlaying() --gets the players ready for teleportation (@)<- that looks like AMONG US
print(playing)
module.ChooseKiller(data_table.killers)
-----------------------------------
-- teleport players
module.TeleportPlayersToSpawners()
-- give killer cards
-- CONTINUE HERE --
-- CONTINUE HERE --
-- CONTINUE HERE --
-- CONTINUE HERE --
-- CONTINUE HERE --
-- CONTINUE HERE --
end
here is the main function that requires the function and this will all be run on the server of course to prevent client from rigging the data (aka exploiters changing it)
edit: oh yeah the data table looks something like
Info.Classical = {
roundduration = 200,
canviewcamera = true,
killers = 1,
minimum_players = 2,
FirstPerson = false,
-- other settings are not added because they are irrelevant and are mainly map stuff and nothing to do with gamemode
}
It looks like you are calling this from the server, and that is how I have it set up as well. Is this something you are interested in, or do you wish to stick with the video style? It is pretty polished at this point for a picker. It is set up for a custom made frame backdrop (card) image.
This is what it can do now. I will most likely keep going with this and make it support any number to pick from. For now, it is focused on five and also happens to support ten. The five is two of each card, or ten different ones. Ten cards rotate in the animation, and the whole thing is hacker proof.
I had that set up to show as a demo. The fire calls were a bit off for real players. Take a look at it again. It is still set up as a demo, but the part you need for real players is there now. Just swap the fire call chunk with the one commented out below it.
Super tricky to work with something you can’t actually test.