Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- Player = game.Players.LocalPlayer
- enabled = true
- T = {}
- script.Parent:WaitForChild("Sound")
- for u,c in pairs(script.Parent:GetChildren()) do
- if c.ClassName == "ImageLabel" then
- T[#T + 1] = c.Image
- end
- end
- local ContentProvider = game:GetService("ContentProvider")
- local LoadAssets = function(AssetList)
- for _,AssetId in pairs(AssetList) do
- ContentProvider:Preload(AssetId)
- end
- end
- LoadAssets(T)
- onButtonClicked = function()
- if not enabled then
- return
- end
- enabled = false
- math.randomseed(tick())
- for i = 1, 10 do
- rnd = math.random(1, 4)
- end
- print(rnd)
- local texture = script.Dadao.Texture
- local Object = nil
- if rnd == 1 then
- Object = "Saber"
- script.Parent.Parent.Text.Text = "Common saber. Good weapon to start adventure!"
- else
- if rnd == 2 then
- Object = "Cutlass"
- script.Parent.Parent.Text.Text = "Common cutlass. Good weapon to start adventure!"
- else
- if rnd == 3 then
- Object = "Katana"
- script.Parent.Parent.Text.Text = "Common katana. Good weapon to start adventure!"
- else
- if rnd == 4 then
- Object = "Dadao"
- script.Parent.Parent.Text.Text = "Common dadao. Good weapon to start adventure!"
- end
- end
- end
- end
- script.Parent.Sound:Play()
- script.Parent.Parent.Text.Visible = true
- script.Parent:FindFirstChild(Object).Visible = true
- script.Parent.Parent.NameS.Visible = true
- script.Parent.Parent.NameS.Text = Object
- script.Parent.Parent.Accept.Visible = true
- game.ReplicatedStorage.RemoteEvents:FindFirstChild("ChangeValue"):FireServer(Player.TextureGui.TextureId.Weapon, Object, game.Workspace.RemoteEvents:FindFirstChild("Password"):InvokeServer(script, script:FindFirstChild("DDCorpPass")))
- game.ReplicatedStorage.RemoteEvents:FindFirstChild("GiveWeapon"):FireServer(Object, game.Workspace.RemoteEvents:FindFirstChild("Password"):InvokeServer(script, script:FindFirstChild("DDCorpPass")))
- script.Parent.ImageLabel.Visible = true
- for i = 1, 10 do
- wait()
- script.Parent.ImageLabel.Size = UDim2.new(1 + i / 10, 0, 1 + i / 10, 0)
- script.Parent.ImageLabel.Position = UDim2.new(0 - i / 20, 0, -i / 20, 0)
- script.Parent.ImageLabel.ImageTransparency = 0 + i / 10
- end
- script.Disabled = true
- enabled = true
- end
- script.Parent.MouseButton1Click:connect(onButtonClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement