#need help plz

1 messages · Page 1 of 1 (latest)

clever sphinx
#

I need a script that gives me €5 every time I kill someone or something in my game, and it should save when the player leaves and when they join again, thanks.

wraith zodiac
clever sphinx
#

ye only need help

#

cuz the mine don't work actually

wraith zodiac
#

Well, if you send your script and any additional information regarding the problem that is occurring, someone will most likely try and help with it

clever sphinx
#

ok , here is the script :

#

local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local eurosStore = DSS:GetDataStore("EurosV1")

local function loadPlayer(plr)
local ls = Instance.new("Folder")
ls.Name = "leaderstats"
ls.Parent = plr
local euros = Instance.new("IntValue")
euros.Name = "Euros"
euros.Parent = ls

local key = "euros_" .. plr.UserId
local ok, data = pcall(function()
    return eurosStore:GetAsync(key)
end)
if ok and typeof(data) == "number" then
    euros.Value = data
else
    euros.Value = 0
end

end

local function savePlayer(plr)
local ls = plr:FindFirstChild("leaderstats")
if not ls then return end
local euros = ls:FindFirstChild("Euros")
if not euros then return end
local key = "euros_" .. plr.UserId
pcall(function()
eurosStore:SetAsync(key, euros.Value)
end)
end

Players.PlayerAdded:Connect(loadPlayer)
Players.PlayerRemoving:Connect(savePlayer)

game:BindToClose(function()
for _, plr in ipairs(Players:GetPlayers()) do
savePlayer(plr)
end
end)

local function award(plr)
local ls = plr:FindFirstChild("leaderstats")
if not ls then return end
local euros = ls:FindFirstChild("Euros")
if not euros then return end
euros.Value = euros.Value + 5
end

#

local function hookHumanoid(h)
if h:GetAttribute("KillHooked") then return end
h:SetAttribute("KillHooked", true)
h.Died:Connect(function()
local tag = h:FindFirstChild("creator")
if tag and tag.Value and tag.Value:IsA("Players") then
award(tag.Value)
end
end)
end

for _, d in ipairs(workspace:GetDescendants()) do
if d:IsA("Humanoid") then
hookHumanoid(d)
end
end

workspace.DescendantAdded:Connect(function(d)
if d:IsA("Humanoid") then
hookHumanoid(d)
end
end)

thin jay
#

tag.Value:IsA("Players") is always false

#

assuming it is objectvalue, its only true if it is set to the players service

#

i assume you meant to write Player there

clever sphinx
#

ho yeah , im stupid i start in scripting... crying

#

thanks

#

And one last thing, I need a script so that my sprint system works on mobile with a Frame plz.

#

here is the Id and the walkspeed :

sprint animation : 122917155859526
sprint walkspeed : 24

tribal nest
#

make it

clever sphinx
#

bro im actually learning script i really need help..

#

im very bad

wraith zodiac
# tribal nest make it

Yeah, like I said in my original response, we'll help you with problems when you reach them, but we aren't going to do free labor and make you one from scratch

clever sphinx
#

i only can do it...

local FOV = 120
game.Workspace.Camera.FieldOfView = FOV

#

well

tribal nest
clever sphinx
#

ye i use ai for big script , but it make a tone of bug

tribal nest
#

learn it

#

copy and pasting wouldn't get you anywhere to your goal

clever sphinx
#

ik

#

but nobody help me in my game so i need help

tribal nest
#

hiring exists

clever sphinx
#

Tidal community is really better.

#

well

#

bye

tribal nest
clever sphinx
#

saybu

wraith zodiac
#

wild

zinc owl
#

dang

steady ledge
#

tf

lofty flicker
#

wo