I made a GUI scoreboard in StarterGui and I am having trouble figuring out how to actually make it work lol.
Heres the script:
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then script.Parent.Text = + 1 end)
Script.Parent is the text label.
Basically, You can add Number
to a Text
because thats the rules.
If you want to then you can create a value of Number
,
Example:
local Number = 0
(You can do it in ServerScript
or LocalScript
)
Just like then and you already created a Number inside of a Script.
To make the Text following the Number, you can do it with a script,
Example:
local Number = 0 while wait() do --Looping script.Parent.Text = Number end
Solution:
local Number = 0 while wait() do --Looping script.Parent.Text = Number end local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then Number += 1 --Add a Value to Number end end)
Notes for You:
(= +) is wrong, the correct one is (+=, No Space)
Write your script with Tools that this site give so we can understand it better
You cant add a Number
to a Text
Hope It Helps!