Hi, I'm currently making a editor for my game in Roblox, and when you click it's meant to place a object, but it doesn't do that. This is the code, if you can fix it in some way, that would be seriously helpful.
local UserInputService = game:GetService('UserInputService')
UserInputService.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
local Mouse = game.Players.LocalPlayer:GetMouse()
local CloneHitCircle = script.Parent.PlaceHitCircle:Clone()
print("Mouse clicked, clone added.")
CloneHitCircle.Image = 'rbxgameasset://Images/Hit_Circle'
CloneHitCircle.Parent = script.Parent
CloneHitCircle.Name = "HitCircle"
CloneHitCircle.Position = UDim2.new(Mouse.X, Mouse.Y)
end
end)

6 comments
Thank you!
I tested this, it didn't work. I don't know why but it just didn't work.
thanks for ignoring what I said "script isn't running".
Uh. I didn't ignore it and also my localscript was running.
I actually found other ways to do this using Instance.new so yeah.
yikes.