MY code:
sword = game.Lighting.ClassicSword
debounce = false
local function onTouch(Object)
if (debounce ~= false) then return end
debounce = true
local char = Object.Parent:FindFirstChild("Humanoid")
if (char ~= nil) then
local play = game.Players:GetPlayerFromCharacter(Object.Parent)
if (play ~= nil) then
game.Workspace.stairswplat.capsule = game.Lighting
game.Lighting.opencapsule = game.Workspace
local swordc = sword:Clone()
swordc = play.Backpack
wait(1)
game.Lighting.capsule = game.Workspace
game.Workspace.stairswplat.opencapsule = game.Lighting
wait(.5)
end
end
debounce = false
end
script.Parent.Touched:connect(onTouch)
As you know, the Lighting folder is basically a store pile for things that aren't in the game. This script... I want it to exchange the capsule with the opencapsule through the Lighting folder. When you touch the model, specifically the middle of the capsule where the script is placed, the capsule model is exchanged with the opencapsule, and a sword is inserted into the player's backpack also from the lighting folder. But the error is "capsule is not a valid member of Model". None of my models are named Model. Help!
