About a year ago I created a horror game called 'lights' in which you were trapped inside a haunted factory that forced to to collect keys which corresponded to certain doors that would help you get out. (Rust Key open rusty door etc.)

The problem is that I believe Roblox changes a lot of their scripting and building scenes for game development leaving my place broken and unusable.

Which changes can I look for? I saw a warning to change "Game" to "game" and "Wait" to "wait". But what else? For example, this still does not work, and it used to.

local Item = script:WaitForChild("Rusty Key") local Sound = game.Lighting:WaitForChild("Pickup") local Debounce = false

script.Parent.Touched:connect(function(hit) if not hit or not hit.Parent or Debounce then return end local Player = game.Players:GetPlayerFromCharacter(hit.Parent) if not Player or not Player:FindFirstChild("Inventory") or Player.Inventory:FindFirstChild(Item.Name) then return end Debounce = true ypcall(function() Item:Clone().Parent = Player.Inventory local Clone = Sound:Clone() Clone.Parent = Player.PlayerGui wait(0.1) Clone:Play() end) wait(0.1) Debounce = false end)

6 comments

0

Is 'inventory' something you put into the player, or is it supposed to be referring to the Backpack?

0

I had a friend help me with some of the scripting, and I believe he was meaning for that to go into the backpack. However this script has been working until Roblox updated so unless they changed it from inventory to backpack I'm not so sure it would be the problem. Is there any way I can check?

0

I changed 'Inventory' to 'Backpack' and the script still does not work and it also does not produce an output.

0

Try taking 'ypcall(function()' out of it. And don't forget to also remove the 'end)' that goes with it.

0

The script still does not work. The script does not even begin to start when I step on the key.

0

Please edit your post to use the Lua formatting option