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

How to make this part perfect in players hand?

Asked by 4 years ago

Hey fellow ScriptingHelpers users, Im making a Piggy style game and Im making it to hold only one item per person and this is my keycard script (All others keys are perfect with same script but with different math) and no, ffs not making those parts tools as it would break the "concept" of the game.

01local key = script.Parent
02 
03script.Parent.ClickDetector.MouseClick:Connect(function(player)
04    local char = player.Character
05 
06    if char:FindFirstChild("Chave") then
07        local oldKey = char:FindFirstChild("Chave")
08        oldKey.Parent = workspace
09        oldKey.WeldConstraint:Destroy()
10        oldKey.CFrame = key.CFrame * CFrame.Angles(0,math.rad(45),0)
11        oldKey.CanCollide = true
12    end
13 
14    if char:FindFirstChild("Martelo") then
15        local oldKey = char:FindFirstChild("Martelo")
View all 30 lines...

Screenshot: http://pays.host/uploads/b0425be8-fb89-4d7b-a116-2fc30390e660/mGivtSmT.png The problem is the commented line, I would be SO much appreaciated if someone helped me, thanks!

1
Please note that "Martelo" means Hammer and "Chave" is Key, forgot to translate it before posting as my game is on another language. LyricalFrog3 45 — 4y
0
Hmmm.... marcusmitevaal -1 — 4y
0
idk try likemakin it longer or maybe have a part that you cant see so it pushes the key card marcusmitevaal -1 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

try pushing the keycard by putting a invisible part and the key card will be pushed i think i haven't tryed it cuz idk how lol.

Ad

Answer this question