I've made a Data script game that I would like people to check out, any ideas for it?
I pretty much did make a cool game testing my skills on scripting. Does it look alright?
(Also game link, not mandatory: https://www.roblox.com/games/4671042633/Data-Storage-Testing-Because-why-not)
Here's the script.
01 | script.Parent.Touched:Connect( function (disk) |
02 | if disk:IsA( "UnionOperation" ) then |
03 | script.Parent.Parent.ScreenName.ScreenNameGui.SG.DName.Text = "Name: " ..disk.Name |
04 | local Data = disk:WaitForChild( "Data" ) |
05 | local Limit = disk:WaitForChild( "Limit" ) |
07 | if Limit.Value = = 2 then |
08 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: " ..#Data.Value |
09 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = Data.Value |
10 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , #Data.Value * Limit.Value , 0 , 50 ) |
11 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = #Data.Value.. "/200" |
12 | elseif Limit.Value = = 1.5 then |
13 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: " ..#Data.Value |
14 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = Data.Value |
15 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , #Data.Value * Limit.Value , 0 , 50 ) |
16 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = #Data.Value.. "/250" |
17 | elseif Limit.Value = = 1 then |
18 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: " ..#Data.Value |
19 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = Data.Value |
20 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , #Data.Value * Limit.Value , 0 , 50 ) |
21 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = #Data.Value.. "/300" |
22 | elseif Limit.Value = = 0.5 then |
23 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: " ..#Data.Value |
24 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = Data.Value |
25 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , #Data.Value * Limit.Value , 0 , 50 ) |
26 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = #Data.Value.. "/350" |
27 | elseif Limit.Value = = 0 then |
28 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: " ..#Data.Value |
29 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = Data.Value |
30 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , #Data.Value , 0 , 50 ) |
31 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = #Data.Value.. "/400" |
40 | script.Parent.Parent.Open.CD.MouseClick:Connect( function () |
42 | script.Parent.Parent.ScreenName.ScreenNameGui.SG.DName.Text = "Name: N/A" |
43 | script.Parent.Parent.ScreenData.ScreenDataGui.SG.DataUsed.Text = "Bytes: 0" |
44 | script.Parent.Parent.Words.ScreenWordsGui.SG.ScrollingFrame.TextBox.Text = "" |
45 | script.Parent.Parent.Bar.BarGui.SG.Size.Size = UDim 2. new( 0 , 0 , 0 , 50 ) |
46 | script.Parent.Parent.Bar.BarGui.SG.Size.SizeText.Text = "" |
And ok, That is a lot to look at.
The 2,1.5,1,0 Numbers you see is hard to explain but i'll try.
The Value "Data" is a StringValue.
There is a value inside of the disk called "Limit" and its a NumberValue.
The limit determines the size of the disk, and the Limit changes a Gui size
The Size limit is 400 because of the block from the Surface Gui on the part.
lets just say...
1 | Data.Value = "Bla Bla Bla" |
4 | script.Parent.Parent.Gui.SufaceGui.Frame.Size = UDim 2. new( 0 ,#Data.Value * 2 , 0 , 50 ) |
And that would do a good amout of math to properly size the Gui to fit and fits to scale on the block.