I am working on a game, similar to Jailbreak, with no police. I am making a bank. You press "e" to blow up the vault. I'm not sure if I have to use a remote event or a remote function.
Here are the two scripts: 1 (Local Script)
local userInputService = game:GetService("UserInputService")
local bar = script.Parent.Bar3
game.ReplicatedStorage.EGuiEvents.EGui2.EnableEGui.OnClientEvent:Connect(function()
if workspace.Vault.Base.CanCollide == true then
script.Parent.Visible = true
end
end)
userInputService.InputBegan:Connect(function(i, g)
if script.Parent.Visible == true then
if i.UserInputType == Enum.UserInputType.Keyboard then
if i.KeyCode == Enum.KeyCode.E then
if workspace.Vault.Base.CanCollide == true then
bar:TweenSize(UDim2.new(0, 70,0, 5), "Out", "Linear", 5)
wait(5)
if bar.Size == UDim2.new(0, 70,0, 5) then
bar.Size = UDim2.new(0, 1,0, 5)
script.Parent.Visible = false
local humanoid = workspace[game.Players.LocalPlayer.Name].Humanoid
local anim = humanoid:LoadAnimation(script.Animovement)
anim:Play()
script:WaitForChild("Script").Disabled = false
script:WaitForChild("Script").Parent = workspace.Bomb
repeat wait(1) until workspace.RobberyInProg == false
spawn(function()
workspace.Bomb:WaitForChild("Script")
workspace.Bomb.Script.Parent = script
script:WaitForChild("Script")
script.Script.Disabled = true
end)
end
end
end
end
end
end)
Script 2 (Sever Script)
player = game.Players:GetPlayerFromCharacter(workspace:FindFirstChild(player.Name))
if player then
repeat wait(1) until script.Parent == workspace
script.Parent.Bomb1.CanCollide = true
script.Parent.Bomb1.Transparency = 0
wait(3.2)
script.Parent.Bomb2.CanCollide = true
script.Parent.Bomb2.Transparency = 0
wait(3.2)
script.Parent.Bomb3.CanCollide = true
script.Parent.Bomb3.Transparency = 0
wait(4)
script.Sound:Play()
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("UnionOperation") then
v.CanCollide = false
v.Transparency = 1
end
end
workspace.Vault.Base.Transparency = 1
workspace.Vault.Base.CanCollide = false
repeat
wait()
until workspace.RobberyInProg == false
script.Parent = game.ReplicatedStorage
workspace.Vault.Base.Transparency = 0
workspace.Vault.Base.CanCollide = false
end
Any help?

1 comment
not really what I asked lol. I'll try to see and learn more, and thank you!