Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This script works in test mode but it doesn't work when I am in game. What do I do?

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.

2 comments

0

Can you put it in Code block so it is easier to read?

0

Do you have Filtering Enabled On?

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.