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

Why is my stamping script not working? [UNSOLVED]

Asked by 10 years ago

I want to make a stamper script kind of like hackthon. (whatever they call it) I made this script:

local storage = game:GetService("Geometry")
local player = game.Players.LocalPlayer
local key =  player:GetMouse()
key.KeyDown:connect(function()
if key == "x" then
local part = Instance.new("Part", storage)
part.Name = "block"
end
end)
key.Clicked:connect(function()
local buildbrick = storage.block:Clone()
buildbrick.Parent = game.Workspace
buildbrick.Position = key.Hit.p
end)
key.KeyDown:connect(function()
if key == "y" then
local tpart = Instance.new("TrussPart", storage)
tpart.Name = "truss"
end
end)
key.Clicked:connect(function()
local buildtruss = storage.truss:Clone()
buildtruss.Parent = game.Workspace
buildtruss.Position = key.Hit.p
end)
key.KeyDown:connect(function()
    if key == "z" then
local bpart = Instance.new("Part", storage)
bpart.Shape = "Ball"
bpart.Name = "ball"
    end
end)
key.Clicked:connect(function()
local buildball = storage.ball:Clone()
buildball.Parent = game.Workspace
buildball.Position = key.Hit.p
end)

I put the script in starterpack.(since localscripts run in backpacks.) When I tested, I pressed 1 key at a time and clicked for each one. Nothing was created. There was also no errors in the output. Can someone point out the problem?

Thanks for reading!

NOTE: I used the geometry service since those parts are based on geometry. I tested the storage by going to online studio by merely, then inserting the disco ball into geometry. It Worked fine.

1
The mouse positioning may be coded wrong. ConnorVIII 448 — 10y
0
What? I searched scripting helpers then this guy had a code in his question with that. So I cut and pasted it. TroytheDestroyer 75 — 10y

Answer this question