Scripting something like this

I think the playtime stats are just values saved for all the players and then sorted out by the greatest. About the likes counter you need the games api Games Api, you can’t make requests directly to that URL from the game so you will need a proxy

1 Like

i meant like the leaderstats as a whole how would I script a leaderboard such as that I don’t have that much idea in scripting

1 Like

aswell as the “you are safe” GUI

1 Like

I would just have some kind of tweening system using a touched event.

A separate script that says:

local gui = -- GUI
local player = game.Players.LocalPlayer
local ts = game:GetService("TweenService")

player.Character.UpperTorso.Touched:Connect(function(hit)
  if hit.Name == "SafeZone" then
    -- add your transparency tween here
  end
end)

player.Character.UpperTorso.TouchEnded:Connect(function(hit)
  if hit.Name == "SafeZone" then
    -- add your transparency tween here
  end
end)


1 Like

Well for global leaderboards you would need to use datastores.
If you don’t know what datastores are, I would advise you to look at tutorials on how they work.

Datastore Tutorial: Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019) - YouTube

Once you finish learning about data stores you may want to use this video to help make the board update: How to Make A Global Leaderboard in Roblox Studio - YouTube

1 Like

Broken this down into the three parts you are looking for here. This should all give you a basic understanding on what to do. Let me know if any of this confuses you or you need extra clarification.

Likes:
Made a post about this just a couple hours ago, check it out if you’re interested.

You are Safe GUI:
Need more information about this to determine when this would show up, but you can use Region3 to determine what area someone is in.

Leaderstats:
I assume these are probably using Roblox ordered datastores. You can check out the following for more information:
Datastores
OrderedDataStore

how do I make said “Tween Transparency”

thank you,

Also Something like this https://gyazo.com/40cb3deef1da9343941bb59a9310acda

1 Like

The you are safe GUI when you enter an area and the GUI pops up and says “you are in the safezone!”
This is for a sword game.

For that, once they step out of the Region3, you can tween the position of specific parts using TweenService. Here’s an example I took straight from that documentation.

local tweenInfo = TweenInfo.new(
	2, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	true, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime
)
 
local tween = TweenService:Create(part, tweenInfo, {Position = Vector3.new(0, 30, 0)})
tween:Play()

What I mean is tweening the transparency from 0 to 1, or from 1 to 0 depending on the event.

For example:

local gui = -- GUI
local player = game.Players.LocalPlayer
local ts = game:GetService("TweenService")

player.Character.UpperTorso.Touched:Connect(function(hit)
  if hit.Name == "SafeZone" then
    local Properties = {
      gui.Transparency = 0
    } 
    local Info = TweenInfo.new(.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 1, false, 0)

    ts:Create(gui, Info, Properties)
    ts:Play()
  end
end)

player.Character.UpperTorso.TouchEnded:Connect(function(hit)
  if hit.Name == "SafeZone" then
    local Properties = {
      gui.Transparency = 1
    } 
    local Info = TweenInfo.new(.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 1, false, 0)

    ts:Create(gui, Info, Properties)
    ts:Play()
  end
end)
1 Like

where would I put this in the port correct?

I don’t really undertand REgion3 So I need an indepth explanation

From my understanding, region 3 is a method to check whether a player is in a said region.

Which is relevant to what you’re working on right now because you’re trying to check if a player is in the safe zone.

Yeah like I said I just started scripting not even a week ago so I dont understand most of this…

This must be in a local script. In StarterPlayerScripts

If I were you, I wouldn’t be getting into things too advanced like this, especially if you only started scripting DAYS ago.

I would watch some tutorials on youtube and experiment with what I already know.

image

I program JS and PY sooo lua shouldnt be too hard haha

LUA might be easy but you gotta understand the engine first, it took me 2 years to really master roblox LUA