button = script.Parent.Place button2 = script.Parent.Remove player = game.Players.LocalPlayer character = player.Character cone = game.ServerStorage.Cone mouse = player:GetMouse() placementpart = player.Character:findFirstChild("Left Leg")
mouse.KeyDown:connect(function(key) if key == ("p") then print("Placing a cone for".. character.Name) a = cone:Clone() a.Parent = game.Workspace a.Position = placementpart.Position a.Name = (character.Name) end end)
button2.MouseButton1Click:connect(function() b = game.Workspace:getChildren() if b.Name == character.Name then b:Destroy() end end)
This is located in startergui inside a screengui. I have tried it with a normal script already.
Use the F9 key to open the developer console and check for errors in online mode. Please format your code using a code block.
mouse.KeyDown is depreciated, either use the UserInputService or ContextActionService.