FUNCTION
local id = --gamepass id here
game.Players.PlayerAdded:Connect(function(player)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
--do what you want to do in here
end
end)
3.9
10
function linearSearch(value, list) {
let found = false;
let position = -1;
let index = 0;
while(!found && index < list.length) {
if(list[index] == value) {
found = true;
position = index;
} else {
index += 1;
}
}
return position;
}
Thank you!
10
0
3.44
9
function factorial(n) {
if (n == 0) {
return 1;
} else {
return factorial(n - 1) * n;
}
}
Thank you!
9
0
4.5
2
funcion name_of_funtion(){
}
Thank you!
2
0
3.5
4
function list_formation(){
$args = array(,
'post_type' => 'categories',
'posts_per_page' => 20,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$formations = get_posts(array(
'post_type' => 'formations',
'post__in' => array(16061),
'meta_query' => array(
array(
'key' => 'categories', // name of custom field
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
));
if($formations){
foreach ($formations as $categorie){
// $list = get_field('formations', $formation->ID);
// list of categorie with ID formation
echo the_title() . '</br>';
}
}
endwhile;
wp_reset_postdata();
Thank you!
4
0
4.6
5
[PHP]
<?php
function helloWorld() {
echo "Hello World";
}
helloWorld();
?>
[Python]
def helloWorld():
print("Hello World")
helloWorld()
[JavaScript / JS Normal Function]
function helloWorld() {
console.log("Hello World!");
}
helloWorld()
[JavaScript / JS Dynamic, Arrow Function]
const helloWorld = () => {
console.log("Hello World!");
}
helloWorld()
Thank you!
5
0
Are there any code examples left?
New code examples in category Lua
-
Lua 2022-03-27 16:30:01 how to use for iv in pairs
-
Lua 2022-03-27 15:10:08 lua last item in table
-
Lua 2022-03-27 07:10:05 how to make a table in lua
-
Lua 2022-03-25 05:45:17 function parameters roblox
-
Lua 2022-03-24 19:50:37 lua variables
-
Lua 2022-03-16 23:30:02 lua list of all keys
-
Lua 2022-03-16 21:40:31 play sound love2d
-
Lua 2022-03-12 11:15:06 how to get the player mouse in roblox studio
-
Lua 2022-03-12 09:40:17 how to add a damage decimal in roblox studio
-
Lua 2022-03-02 18:40:19 lowercase lua