Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- button = script.Parent.ShopButton
- PassFrame = script.Parent.Frame
- function plus()
- PassFrame.Visible = not PassFrame.Visible
- end
- button.MouseButton1Click:Connect(plus)
- -----------------------------------------------------------
- local ServerStorage = game:GetService("ServerStorage")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local GiveWeaponEvent = ReplicatedStorage:WaitForChild("GiveWeapon")
- function onEvent1(player, gunName)
- local backpack = player:WaitForChild("Backpack")
- local Gun = ServerStorage:FindFirstChild("Weapons"):FindFirstChild(gunName)
- local clone = Gun:Clone()
- clone.Parent = backpack
- end
- GiveWeaponEvent.OnServerEvent:Connect(onEvent1)
- -------------------------------------------------------------
- local player = game.Players.LocalPlayer
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local GiveWeaponEvent = ReplicatedStorage:WaitForChild("GiveWeapon")
- local gunName = script.Parent.Name
- local Frame = script.Parent.Parent
- script.Parent.MouseButton1Down:Connect(function()
- Frame.Visible = false
- GiveWeaponEvent:FireServer(gunName)
- end)
- --------------------------------------------------------------
- script.Parent.Humanoid.Died:Connect(function()
- print("NPC уничтожен")
- wait(3)
- script.Parent:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement