|
| 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 |
|