How do you make something placeable on the ground, avoiding the camera?
I'm making a Tower Defense game, and I'm trying to make a Tower place on the ground, and certain parts of it, but it wont work.
Anyone able to help?
01 | local plr = game.Players.LocalPlayer |
02 | local mouse = plr:GetMouse() |
05 | if game.ReplicatedStorage.Stats.Cash.Value > = 170 and enabled = = false then |
07 | game.ReplicatedStorage.Stats.Cash.Value = game.ReplicatedStorage.Stats.Cash.Value - 170 |
08 | local tower = game.ReplicatedStorage.Towers.DartPart:Clone() |
09 | tower.Parent = workspace.Towers |
12 | mouse.TargetFilter = workspace.Land |
13 | tower.PrimaryPart = tower.Part |
15 | tower:SetPrimaryPartCFrame(mouse.Hit*CFrame.Angles(math.pi/ 2 , 0 , 0 )*CFrame.new( 0 ,- 1 , 0 )) |
19 | script.Parent.MouseButton 1 Click:connect(onClick) |
(i'm fully aware it needs to be FE converted, im doing that later)