I have a script that when players step on a block they get a sword, but as soon as they step off of the block, the sword disappears. The script works perfectly fine until we use the :maprestore command from Kohls Commands [epix edit]. The maprestore is necessary for the game, but when we do it, the sf area block stops working completely. Script for block is below :
X1=script.Parent.Position.X-script.Parent.Size.X*.5
X2=script.Parent.Position.X+script.Parent.Size.X*.5
Z1=script.Parent.Position.Z-script.Parent.Size.Z*.5
Z2=script.Parent.Position.Z+script.Parent.Size.Z*.5
game.Players.PlayerAdded:connect(function(Plr)
repeat wait() until Plr.Character:FindFirstChild("Torso")
local PlrIn=false
while wait() do
if X1<Plr.Character.Torso.Position.X and Plr.Character.Torso.Position.X<X2 and Z1<Plr.Character.Torso.Position.Z and Plr.Character.Torso.Position.Z<Z2 then
if PlrIn==false then
print("Player is inside")
PlrIn=true
local WeaponClone=game.Lighting.Sword:clone()
WeaponClone.Parent=Plr.Character
end
else
if PlrIn==true then
if Plr.Character:FindFirstChild("Sword") then
Plr.Character:FindFirstChild("Sword"):remove()
elseif Plr.Backpack:FindFirstChild("Sword") then
Plr.Backpack:FindFirstChild("Sword"):remove()
end
print("Player is outside")
PlrIn=false
end
end
end
end)
-FredMango
