Bean666 Posted March 5, 2021 Posted March 5, 2021 Hello i'm tryna make a shop with a gridlist + editbox and a button smth like this: So how do i get to get this work: Ik i'll probably use guiGetText on the editbox but how do I make if in the editbox: 10, the event will trigger 10 times as well or the money needed on a single purchase would be multiplied by 10x and he will get 10x the amount of the single purchase.
Haxardous Posted March 5, 2021 Posted March 5, 2021 (edited) -- if you want to trigger something 10 or multiple times you can use "for" loop. for i = 1, 10 do -- trigger your thingies end -- if you want to multiply something you will need to use the * operator. local price = 1000 local amount = 10 function multiply(price, amount) return price * amount end print(multiply(price, amount)) -- should return 10000. Edited March 5, 2021 by Haxardous 1
Tekken Posted March 6, 2021 Posted March 6, 2021 (edited) So let’s say your item costs 5 and in the edit box you enter 3 so all you do is itemPrice * guiQuantity; (in our case 5 * 3 = 15) also you should do if the editbox is empty guiQuantity = 1; Edited March 6, 2021 by Tekken
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now