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

[SOLVED ]Model doesn't move to correct position?

Asked by
Cuvette 246 Moderation Voter
8 years ago

Just before I start, everything in my script is pointing towards the right parts and models. But to put it simply, when you acquire a plot of land the models you have already saved and loaded in are supposed to move to the correct position of the new plot. But instead they load up where they were saved, and that could be in an old plot of land someone is using.

Here is the script.

script.Parent.Head.Touched:connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player ~= nil then
                    if script.Parent.Parent.Parent.Owner.Value == nil then
                        if game.Workspace:FindFirstChild(player.Name.."'s House") == nil then
                        if hit.Parent:FindFirstChild("Humanoid") then
                            if hit.Parent.Humanoid.Health > 0 then
                                script.Parent.Parent.Parent.Owner.Value = player
                                script.Parent.Name = player.Name.."'s House"
                                script.Parent.Head.Transparency = 0.6
                                script.Parent.Head.CanCollide = false
                                script.Parent.Parent.Parent.Name = player.Name.."'s House"
                                script.Parent.Parent.Parent.Floor.Name = player.Name.."Floor"
                                local movearea = script.Parent.Parent.Parent.BoundingArea
                                Parts = player:LoadInstance("BuildingBricks10")
                                 Parts:MoveTo(Vector3.new(movearea.Position.X,34,movearea.Position.Z))
                                Parts.Parent = script.Parent.Parent.Parent.SavedObjects
                                script.Parent:remove()
                                end
                            end
                        end
                    end
                end
end)

Answer this question