Why wont my coin giver script work outside of roblox studio but will work in the studio?
Hello, and thank you for taking the time to resolve my problem.
So I have a couple of scripts that are supposed to show a gui to some people and when they click on it they should receive money. These scripts work in roblox studio, and when the person clicks on the gui it will give them the money. However, when I leave the studio or start a local server to test the scripts it will show the gui, but they don't receive the money and nothing happens. I want to be able to get money when the gui is clicked. I'm not entirely sure where the problem is so sorry for the inconvenience. If more code is needed I will gladly give more code however I thought this would be necessary to include. I do have school so sorry for long time for response.
Code:
AddMoney
2 | script.Parent.Mo [ ] (http://)useButton 1 Click:connect( function (player) |
3 | script.Parent.Parent.Parent.Parent.leaderstats.Coins.Value = script.Parent.Parent.Parent.Parent.leaderstats.Coins.Value + 5 |
Leader Board Script
02 | game.Players.PlayerAdded:connect( function (player) |
03 | local leader = Instance.new( "Model" ) |
04 | leader.Name = "leaderstats" |
07 | local coins = Instance.new( "IntValue" ) |
10 | coins.Parent = player.leaderstats |
12 | local kills = Instance.new( "IntValue" ) |
15 | kills.Parent = player.leaderstats |
Image 1
Image 2