Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Part0 = Instance.new("Part")
- SurfaceGui1 = Instance.new("SurfaceGui")
- TextButton2 = Instance.new("TextButton")
- Script3 = Instance.new("Script")
- Part0.Name = "Click me :D"
- Part0.Parent = mas
- Part0.Anchored = true
- Part0.Size = Vector3.new(19.8299961, 15.9699993, 2)
- Part0.CFrame = CFrame.new(21.4750061, 7.98500347, -15.1499996, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part0.BottomSurface = Enum.SurfaceType.Smooth
- Part0.TopSurface = Enum.SurfaceType.Smooth
- Part0.Position = Vector3.new(21.4750061, 7.98500347, -15.1499996)
- SurfaceGui1.Parent = Part0
- SurfaceGui1.Face = Enum.NormalId.Back
- TextButton2.Parent = SurfaceGui1
- TextButton2.Size = UDim2.new(0, 395, 0, 374)
- TextButton2.Text = "This button has been clicked 0 times!"
- TextButton2.Position = UDim2.new(0, 223, 0, 101)
- TextButton2.BackgroundColor3 = Color3.new(1, 0, 0.901961)
- TextButton2.Font = Enum.Font.SourceSans
- TextButton2.FontSize = Enum.FontSize.Size96
- TextButton2.TextScaled = true
- TextButton2.TextWrapped = true
- Script3.Parent = TextButton2
- table.insert(cors,sandbox(Script3,function()
- click = 0
- function onClick(plyr)
- click = click+1
- print(click)
- script.Parent.Text = ("This button has been clicked {{{" .. click .. "}}} times!")
- end
- script.Parent.MouseButton1Down:connect(onClick)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement