-
What do you want to achieve?
I want to activate a script in a keycard model using a proximity prompt that causes it to disappear (“picked up”) . The model is hidden and will be translated to a table, after the player has clicked a screen gui. -
What is the issue?
The proximity prompt does not activate after the model has been translated, and there is no errors in Output. The prompt works before the translation though, and the translation itself works. -
What solutions have you tried so far?
I haven’t found a solution for the issue I’ve encountered. I’ve tried using cframe, and position changes for individual parts but that didn’t work either.
Script inside the prompt:
local Card = script.Parent.Parent.Parent.Parent
local Values = workspace.Values
local CardValue = Values.ItemValues.ConverterCard
local sound = Card.Main.Sound
script.Parent.Triggered:Connect(function(player)
CardValue.Value = true
script.Parent.Enabled = false
local orb = Instance.new("Part")
orb.Parent = Card.Parent
orb.CanCollide = false
orb.Size = Vector3.new(1.5,1.5,1.5)
orb.BrickColor = BrickColor.new("Mint")
orb.Material = Enum.Material.Neon
orb.Shape = Enum.PartType.Ball
orb.CFrame = Card.PrimaryPart.CFrame
orb.Anchored = true
sound:Play()
wait(sound.TimeLength)
orb:Destroy()
Card:Destroy()
end)
This is the script for the gui text button:
local options = script.Parent.Parent
local NPCChat = script.Parent.Parent.Parent.Parent.MainText.Dialogue
local Character = game.Workspace.NPC.Other.rofrown
local function OnClick()
NPCChat.Text = "Have you restored the power?"
game.Workspace.Values.ChatValues.RofrownChat.StartedQuest1.Value = true
script.Parent.Text = "Yes I have."
script.Parent.Visible = false
options.Dialgoue2.Visible = true
script.Parent.Dialogue5.Enabled = true
options.Parent.Parent.Visible = false
Character.HumanoidRootPart.PromptAttachment.ProximityPrompt.Enabled = true
game.Workspace.QuestItems.ConverterKeycard:TranslateBy(Vector3.new(0, 17, 0))
script.Enabled = false
end
script.Parent.MouseButton1Click:connect(OnClick)