This script for my DevProduct gui works fine in studio, but not in-game. What's wrong with it?
Asked by
7 years ago Edited 7 years ago
So, basically. This is just supposed to be a simple to use DevProduct gui. The player gets a gui, places it in the Y position they want and the script will do the rest. Anyway, the script works well in studio, however when I test it in game, it only works for the first one.
Here is what happens...
In studio
In a server
Anyway, without any further due, here's the script:
01 | for i,v in pairs (script.Parent:GetChildren()) do |
02 | local player = game.Players.LocalPlayer |
03 | if v:IsA( "TextButton" ) then |
04 | v.MouseEnter:connect( function () |
05 | v:TweenPosition(UDim 2. new( 1 ,- 200 ,v.Position.Y.Scale,v.Position.Y.Offset), 'In' , 'Sine' , 0.3 , true ) |
07 | v.MouseLeave:connect( function () |
08 | v:TweenPosition(UDim 2. new( 1 ,- 50 ,v.Position.Y.Scale,v.Position.Y.Offset), 'In' , 'Sine' , 0.3 , true ) |
10 | v.MouseButton 1 Click:connect( function () |
11 | game.MarketplaceService:PromptProductPurchase(player, tonumber (v.Name)) |
I also tried this:
01 | for i,v in pairs (script.Parent:GetChildren()) do |
02 | local player = game.Players.LocalPlayer |
03 | if v:IsA( "TextButton" ) then |
04 | v.MouseEnter:connect( function () |
05 | v:TweenPosition(UDim 2. new( 1 ,- 200 ,v.Position.Y.Scale,v.Position.Y.Offset), 'In' , 'Sine' , 0.3 , true ) |
07 | v.MouseLeave:connect( function () |
08 | v:TweenPosition(UDim 2. new( 1 ,- 50 ,v.Position.Y.Scale,v.Position.Y.Offset), 'In' , 'Sine' , 0.3 , true ) |
10 | v.MouseButton 1 Click:connect( function () |
11 | game.MarketplaceService:PromptProductPurchase(player, tonumber (v.Name)) |
But I still got the same result.
Thanks,
Rodrigo455