-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.lua
129 lines (112 loc) · 3.95 KB
/
script.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
-- Made by snow_fear#7003
if loaded == true then
game:GetService("StarterGui"):SetCore("SendNotification",{
Title = "Loaded",
Text = "The script is already running!", -- Checks if script is already loaded
Icon = "rbxassetid://6022668888"
})
return
end
pcall(function() getgenv().loaded = true end)
-- Instances:
local Main = Instance.new("ScreenGui")
local Button = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
--Properties:
Main.Name = "Main"
Main.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
Main.ResetOnSpawn = false
Button.Name = "Button"
Button.Parent = Main
Button.BackgroundColor3 = Color3.fromRGB(0, 4, 255)
Button.BorderSizePixel = 0
Button.Position = UDim2.new(0.760210335, 0, 0.27510047, 0)
Button.Size = UDim2.new(0, 50, 0, 31)
Button.Font = Enum.Font.LuckiestGuy
Button.Text = "Start"
Button.TextColor3 = Color3.fromRGB(255, 255, 255)
Button.TextSize = 17.000
Button.TextWrapped = true
UICorner.Parent = Button
-- Scripts:
local function YTNSK_fake_script() -- Button.Toggle
local script = Instance.new('LocalScript', Button)
local Player = game:GetService("Players").LocalPlayer
local valid = true
local args = {
[1] = CFrame.new(1,1,1) -- Any args work here lmao
}
function repeating(State)
if State == "On" then
Player.PlayerGui.Main.Button.Text = "On"
valid = false
State = "Off"
game.Players.LocalPlayer.CharacterAdded:Connect(function()
valid = true
game:GetService("Players").LocalPlayer.Character:WaitForChild("HumanoidRootPart") -- Debug
valid = false
end)
while valid == false do
wait(0.1)
game:GetService("Players").LocalPlayer.Character:WaitForChild("HumanoidRootPart")
game:GetService("Players").LocalPlayer.Character:WaitForChild("Main") -- The function itself (Kinda messy)
game:GetService("Players").LocalPlayer.Character.Main:WaitForChild("Swing")
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(-114.755913, 1896.27734, 208.189117) -- Tomura's CFrame
game:GetService("Players").LocalPlayer.Character.Main.Swing:FireServer(unpack(args))
end
else
Player.PlayerGui.Main.Button.Text = "Off"
State = "On"
valid = true
end
end
Player.PlayerGui.Main.Button.MouseButton1Click:Connect(function() -- A little bit more clean
if valid then
repeating("On")
else
repeating("Off")
end
end)
end
coroutine.wrap(YTNSK_fake_script)()
local function DICPVYF_fake_script() -- Button.Drag
local script = Instance.new('LocalScript', Button)
--Credits go to whoever made this script. (This one runs independently, it just makes the button to drag smoothly, but i could certainly be replace by the legacy draggable)
local UIS = game:GetService("UserInputService")
function drag (Frame)
dragToggle = nil
dragSpeed = 0.23
dragInput = nil
dragStart = nil
dragPos = nil
function updateInput(input)
Delta = input.Position - dragStart
Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.25), {Position = Position}):Play()
end
Frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then
dragToggle = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragToggle then
updateInput(input)
end
end)
end
drag(script.Parent)
end
coroutine.wrap(DICPVYF_fake_script)()