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

How do you make something placeable on the ground, avoiding the camera?

Asked by
Kurcha 33
6 years ago

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?

01local plr  = game.Players.LocalPlayer
02local mouse = plr:GetMouse()
03enabled = false
04function onClick()
05if game.ReplicatedStorage.Stats.Cash.Value >= 170 and enabled == false then
06enabled = true
07game.ReplicatedStorage.Stats.Cash.Value = game.ReplicatedStorage.Stats.Cash.Value - 170
08local tower = game.ReplicatedStorage.Towers.DartPart:Clone()
09tower.Parent = workspace.Towers
10while enabled do
11wait()
12mouse.TargetFilter = workspace.Land
13tower.PrimaryPart = tower.Part
14wait()
15tower:SetPrimaryPartCFrame(mouse.Hit*CFrame.Angles(math.pi/2,0,0)*CFrame.new(0,-1,0))
16end
17end
18end
19script.Parent.MouseButton1Click:connect(onClick)

(i'm fully aware it needs to be FE converted, im doing that later)

0
It is, but it goes over way too many things for me to even see what I'm supposed to do. Kurcha 33 — 6y

Answer this question