I want to make an user chose there gravity but the code i am using it does not work. This is the code:
local TextBox = script.Parent.Parent.TextBox
game.Workspace.Gravity = TextBox
I want to make an user chose there gravity but the code i am using it does not work. This is the code:
local TextBox = script.Parent.Parent.TextBox
game.Workspace.Gravity = TextBox
I'm assuming you just started in Lua, but the reason it is not working is because you need to use the TextBox's 'Text' value so the gravity can actually change. This is what you'd do:
local TextBox = script.Parent.Parent.TextBox
game.Workspace.Gravity = TextBox.Text
When you have it as that, it will detect a numerical value to set your gravity to, like 100.
Hoped this helped!
Sorry But That does not work ether
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
That script will only run once when you join the game, you need an event or something to trigger the code to run again, like a button when clicked or when the user press enter