|
| 15 Jul 2017 09:51 PM |
I am trying to make a system to change the player's house to a better one once they have the correct amount of money, but when I play the game to test it, it doesn't clone the house and set its parent to the house-in-game folder under the workspace.
Here is the code to check the money of the player (It's a localscript)
while(loop==true) do local money = game.Players.LocalPlayer.leaderstats.Money.Value if game.Players.LocalPlayer.leaderstats.Money.Value > 0 and game.Players.LocalPlayer.leaderstats.Money.Value < 3000 then local player = game.Players.LocalPlayer wait(1) game.ServerScriptService.addHouse.Adder:FireServer() end end And here is the code for the server script
script.Adder.OnServerEvent:connect(function(player) local homeloc = player.Homeloc.Value local Home = game.Workspace.HouseScripts.Houses.Crate:Clone() Home.Parent = game.Workspace.HouseScripts.HouseInGame Home:MoveTo(Vector3.new(player.Homeloc.Value)) end)
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 126 |
|
|
| 15 Jul 2017 09:52 PM |
what is
while "(loop==true)" do |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 09:56 PM |
It was the time what I thought to be a type of loop, I fixed that but it still doesn't work with "While true do"
|
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 09:57 PM |
Also, I had defined "local loop=true" before that
|
|
|
| Report Abuse |
|
|
| |
|
| |
|