Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my coin giver script work outside of roblox studio but will work in the studio?

Asked by 7 years ago

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

1while true do
2script.Parent.Mo[](http://)useButton1Click:connect(function(player)
3script.Parent.Parent.Parent.Parent.leaderstats.Coins.Value = script.Parent.Parent.Parent.Parent.leaderstats.Coins.Value + 5
4wait(0.1)
5end)
6wait(0.1)
7end

Leader Board Script

01while (true) do
02game.Players.PlayerAdded:connect(function(player)
03local leader = Instance.new("Model")
04leader.Name = "leaderstats"
05leader.Parent = player
06 
07local coins = Instance.new("IntValue")
08coins.Name = "Coins"
09coins.Value = 0
10coins.Parent = player.leaderstats
11 
12local kills = Instance.new("IntValue")
13kills.Name = "Kills"
14kills.Value = 0
15kills.Parent = player.leaderstats
16end)
17wait(0.1)
18end

Image 1

Image 2

Answer this question