Help to make a Value maker

I want a script that makes a folder with a number value and that number value is whatever the value is what they typed
i dont want letters in the text box
and i want it to go to a server script

-- local event = game.ReplicatedStorage:WaitForChild("RequestUser")
-- local plr = game.Players.LocalPlayer

-- local inputbox = script.Parent.Parent.InputBox

To make a folder, do

local Folder = Instance.new("Folder")

Folder.Name = "Something" -- Name of Folder

Now, to get a number from the TextBox, you need to do:

local Number = tonumber(TextBox.Text) -- Converts String to Number 

if number then -- if it's a number then, fire remote event
      RemoteEvent:FireServer(number)

else
-- Do nothing
end

This isn’t the full script, you will need to complete it using the info I gave you.

You will also need another script on the server that changes the number when the remote event is fired.

tonumber

Remote Event

Can you make it like that it makes a folder on the server side and a value with the number in it?

?

function folder(name,location)
local folder = Instance.new("Folder",location)
folder.Name = name
folder.Parent = location
end
function createvalue(whatisit,name)
--what is it means what object, as example put NumberValue.
local value = Instance.new(whatisit,**put folder location here**)
value.Name = name
end
--continue ur script

And then the value is the value i got from the text box

Script for Server:

local folder = Instance.new(“Folder”, workspace)

game.ReplicatedStorage.RequestUser.OnServerEvent:Connect(function(number)
   local value = Instance.new(“NumberValue”, folder)
   value.Value = number
end)

How to fire the event from the client side:

local event = game.ReplicatedStorage.RequestUser

event:FireServer(3) - if you follow my steps, the folder should have a NumberValue inside of it, with the value of 3 - 

Just fire the code whenever you need in your script. Maybe this will help:

https://developer.roblox.com/en-us/api-reference/event/TextBox/FocusLost

Hope this helps :slight_smile:

1 Like