Sorry for reposting this but I’m trying to fix a timer in my obby so people can have fun competing. The rest of the scripts for the timer and the leaderboard work perfectly fine but I just wanted the script to do the opposite of what the youtuber put at the top! I want to make it so that even if the player dies from start to finish, they can have a time on the leaderboard still. Like I said, it works flawlessly but I just want to make it so that even if the player dies from when they touch the StartTimer and the EndTimer, they can still have a spot on the leaderboard! Only things I changed in this script is the Datastore thingy that says “leaderboardData5” and the Anti-cheat timer! Pay attention to the words at the top of the script please!
--[[
@author TwinPlayzDev_YT
@since 6/1/2021
This script will apply the leaderboard time, and check if a player has finished or completed the obby.
Only saves time when they fully complete course without dieing.
--]]
-- [ SERVICES ] --
local DataStoreService = game:GetService("DataStoreService")
-- [ LOCALS ] --
local DataVer = "[DataTimer]" -- Data Store Name
local Store = DataStoreService:GetOrderedDataStore("LeaderBoardData5")
-- [ FUNCTIONS ] --
_G.ForceSet = function(plrName, newTime)
local num = tonumber(newTime)
num = num * 1000
Store:SetAsync(plrName, num)
end
game.ReplicatedStorage.ApplyTime.OnServerEvent:Connect(function(plr, newTime) -- On Event
local num = tonumber(newTime)
local oldData = Store:GetAsync(plr.UserId)
if oldData then
oldData = oldData / 1000
else
oldData = 1000
end
---- ANTI CHEAT (needs fixing)
if num < oldData then
if num <= 900.00 then
plr:Kick("No cheating bucko!")
else
num = num * 1000
Store:SetAsync(plr.UserId, num)
end
end
end)
Also, no need to get aggressive dude lol. I’m a beginner and I thought the devforum was where I could come for help and feedback. Hell, I’m sure you needed help when you first started out too! This is what I changed it to if you or anybody else wants to help, do you think it’s correct or should I move the BindToClose function to the end?
--[[
@author TwinPlayzDev_YT
@since 6/1/2021
This script will apply the leaderboard time, and check if a player has finished or completed the obby.
Only saves time when they fully complete course without dieing.
--]]
game:BindToClose(function()
task.wait(5)
end)
-- [ SERVICES ] --
local DataStoreService = game:GetService("DataStoreService")
-- [ LOCALS ] --
local DataVer = "[DataTimer]" -- Data Store Name
local Store = DataStoreService:GetOrderedDataStore("LeaderBoardData5")
-- [ FUNCTIONS ] --
_G.ForceSet = function(plrName, newTime)
local num = tonumber(newTime)
num = num * 1000
Store:SetAsync(plrName, num)
end
game.ReplicatedStorage.ApplyTime.OnServerEvent:Connect(function(plr, newTime) -- On Event
local num = tonumber(newTime)
local oldData = Store:GetAsync(plr.UserId)
if oldData then
oldData = oldData / 1000
else
oldData = 1000
end
---- ANTI CHEAT (needs fixing)
if num < oldData then
if num <= 900.00 then
plr:Kick("No cheating bucko!")
else
num = num * 1000
Store:SetAsync(plr.UserId, num)
end
end
end)
The statement you provided can be perceived as somewhat assertive or impatient, but it’s not overtly aggressive. You were obviously expressing frustration or annoyance because you’ve provided the solution multiple times and don’t want to repeat yourself. Whilst you may have done so, this person had no idea, or probably couldn’t find it as he said he’s been stressing about it over a month, you could of had just simply stated you’ve gone through this before and linked it.
Hey Matthew how are you? Also it’s all good man, I don’t want y’all arguing about it. I’m just making posts about this because no matter what I do or what advice anybody gives, it just will not work. Not many people give direct answers on here, it’s always “remoteevent this” and “datastore that” and me being a beginner i’m always lost! Hopefully I find a solution soon though.