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

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

Asked by 6 years ago

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.

0
Can you put it in Code block so it is easier to read? The_sandwic 14 — 6y
0
Do you have Filtering Enabled On? CrazyRoblots 13 — 6y

1 answer

Log in to vote
0
Answered by
Eqicness 255 Moderation Voter
6 years ago
Edited 6 years ago

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.

Ad

Answer this question