Hi, I'm trying to create a build preview. Where a transparent version of the part appears and follows your mouse until you like where it is then when you click it places it in that position. The problem I'm having is when you click the button to start the build preview it just places the part where you clicked it doesn't follow the mouse at all.
Here is the script I'm using, this is a localscript located inside a GUI textbutton:
script.Parent.MouseButton1Down:connect(function()
GUI = script.Parent.Parent.Parent.Parent
Wall = game.ServerStorage.WoodWall
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
if Player.leaderstats.Wood.Value >= 5 then
Player.leaderstats.Wood.Value = Player.leaderstats.Wood.Value -5
GUI.Visible = false
WWall = Wall:Clone()
WWall.Parent = game.Workspace
WWall.Transparency = .5
WWall.Position = Mouse.hit.p
end
end)

5 comments
That didn't work that just made the part spawn in the position it was made in when i moved it into server storage.
oh I'll fix that
try it now
line 17 the end need a ")" also your condition line 7, remove your "end" line 16 and add an end line 13
I fixed it, I didn't use studio to format it properly which caused these mistakes