How to make an advanced clicking simulator game on Roblox! | Episode 1
63.7 هزار بار بازدید -
2 سال پیش
-
In this video I will
In this video I will show you how to make a clicking simulator!
Roblox Group : https://web.roblox.com/groups/1382548...
I recommend scripting it yourself because it will help you learn how to script on your own!
Script :
-----------------------------------------------------------------------------------------------------------------------
leaderstats :
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("ExampleSave")
game.Players.PlayerAdded:Connect(function(Player)
if not Player:FindFirstChild("leaderstats") then
local Folder = Instance.new("Folder" ,Player)
Folder.Name = "leaderstats"
end
local Folder = Player:WaitForChild("leaderstats" ,5)
local Value1 = Instance.new("IntValue",Folder)
local Value2 = Instance.new("IntValue",Folder)
local Value3 = Instance.new("IntValue",Folder)
Value3.Name = "Clicks"
Value1.Name = "Gems"
Value2.Name = "Rebirths"
local GetData = ds:GetAsync(Player.UserId)
if GetData ~= nil then
Value1.Value = GetData[1]
Value2.Value = GetData[2]
Value3.Value = GetData[3]
else
Value1.Value = 0
Value2.Value = 0
Value3.Value = 0
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
local SaveData = {}
for _,Child in pairs(Player.leaderstats:GetChildren())do
table.insert(SaveData,Child.Value)
end
ds:SetAsync(Player.UserId, SaveData)
end)
ClickButton :
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local clicks = player.leaderstats.Clicks
clicks.Value = clicks.Value + 1
end)
ShowClicks :
click = 0
local plr = game.Players.LocalPlayer
while wait() do
if click ~= plr.leaderstats.Clicks.Value then
local random = math.random(1,1000)
local xnew = random/1000
local new = game.ReplicatedStorage.PlusClick:Clone()
new.Parent = script.Parent
new.Position = UDim2.new(xnew,0,1,0)
new.Text = "+1"
click = plr.leaderstats.Clicks.Value
end
end
Plusclick Textlable :
wait()
script.Parent:TweenPosition(UDim2.new(script.Parent.Position.X,0,-0.1,0))
wait()
for i = 1,20 do
script.Parent.TextStrokeTransparency = script.Parent.TextStrokeTransparency + 0.05
script.Parent. TextTransparency = script.Parent.TextTransparency + 0.05
wait()
end
Clicks Amount :
while wait() do
local player = game.Players.LocalPlayer
local clicks = player.leaderstats.Clicks
script.Parent.Text = clicks.Value
end
Roblox Group : https://web.roblox.com/groups/1382548...
I recommend scripting it yourself because it will help you learn how to script on your own!
Script :
-----------------------------------------------------------------------------------------------------------------------
leaderstats :
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("ExampleSave")
game.Players.PlayerAdded:Connect(function(Player)
if not Player:FindFirstChild("leaderstats") then
local Folder = Instance.new("Folder" ,Player)
Folder.Name = "leaderstats"
end
local Folder = Player:WaitForChild("leaderstats" ,5)
local Value1 = Instance.new("IntValue",Folder)
local Value2 = Instance.new("IntValue",Folder)
local Value3 = Instance.new("IntValue",Folder)
Value3.Name = "Clicks"
Value1.Name = "Gems"
Value2.Name = "Rebirths"
local GetData = ds:GetAsync(Player.UserId)
if GetData ~= nil then
Value1.Value = GetData[1]
Value2.Value = GetData[2]
Value3.Value = GetData[3]
else
Value1.Value = 0
Value2.Value = 0
Value3.Value = 0
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
local SaveData = {}
for _,Child in pairs(Player.leaderstats:GetChildren())do
table.insert(SaveData,Child.Value)
end
ds:SetAsync(Player.UserId, SaveData)
end)
ClickButton :
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local clicks = player.leaderstats.Clicks
clicks.Value = clicks.Value + 1
end)
ShowClicks :
click = 0
local plr = game.Players.LocalPlayer
while wait() do
if click ~= plr.leaderstats.Clicks.Value then
local random = math.random(1,1000)
local xnew = random/1000
local new = game.ReplicatedStorage.PlusClick:Clone()
new.Parent = script.Parent
new.Position = UDim2.new(xnew,0,1,0)
new.Text = "+1"
click = plr.leaderstats.Clicks.Value
end
end
Plusclick Textlable :
wait()
script.Parent:TweenPosition(UDim2.new(script.Parent.Position.X,0,-0.1,0))
wait()
for i = 1,20 do
script.Parent.TextStrokeTransparency = script.Parent.TextStrokeTransparency + 0.05
script.Parent. TextTransparency = script.Parent.TextTransparency + 0.05
wait()
end
Clicks Amount :
while wait() do
local player = game.Players.LocalPlayer
local clicks = player.leaderstats.Clicks
script.Parent.Text = clicks.Value
end
2 سال پیش
در تاریخ 1401/03/09 منتشر شده
است.
63,725
بـار بازدید شده