Files
PlaneBuilding/scripts/modules/GamemodeModule.lua
T

36 lines
1008 B
Lua

function init(this,mode)
if mode == "Survival" then
this.Parent.Triggered:Connect(function(player)
for _,tool in pairs(player.Character:GetChildren()) do
if tool:IsA("Tool") then
tool:Destroy()
end
end
for _,tool in pairs(player.Backpack:GetChildren()) do
if tool:IsA("Tool") then
tool:Destroy()
end
end
for _,tool in pairs(_G.Storage.Tools:GetChildren()) do
tool:Clone().Parent = player.Backpack
end
player.Character:SetPrimaryPartCFrame(game.Workspace.Heaven.AngelSpawn.CFrame+Vector3.new(0,4,0))
end)
end
if mode == "Heaven" then
this.Parent.Triggered:Connect(function(player)
for _,tool in pairs(player.Character:GetChildren()) do
if tool:IsA("Tool") then
tool:Destroy()
end
end
for _,tool in pairs(player.Backpack:GetChildren()) do
if tool:IsA("Tool") then
tool:Destroy()
end
end
player.Character:SetPrimaryPartCFrame(game.Workspace.GoonSpawn.CFrame+Vector3.new(0,4,0))
end)
end
end
return getfenv()