Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Expected 'end' (to close 'then' at line 55), got <eof>; did you forget to close 'do' at line 98?  

Asked by 4 years ago

I am making a sword fighting game and I can't figure out how to fix it

here's the code

local dataStores = game:GetService("DataStoreService"):GetDataStore("BucksDataStore") local defaultCash = 50 local playersLeft = 0

game.Players.PlayerAdded:Connect (function(player)

01playersLeft = playersLeft + 1
02 
03local leaderstats = Instance.new("Folder")
04leaderstats.Name = "leaderstats"   
05leaderstats.Parent = player
06 
07local bucks = Instance.new("IntValue"
08bucks.Name = "Bucks"
09bucks.Value = 0
10bucks.Parent = leaderstats
11 
12local playerData = Instance.new("Folder")
13playerData.Name = player.Name
14playerData.Parent = game.ServerStorage.PlayerData
15 
View all 74 lines...

end

local bindableEvent = Instance.new("BindableEvent")

game.Players.PlayerRemoving:Connect(function(player) pcall(function() dataStores:SetAsync(player.UserId.."-Bucks",player.leaderstats.Bucks.Value) print("Saved") playersLeft = playersLeft - 1 bindableEvent:Fire() end)

end)

game:BindToClose(function() -- This will be triggered upon shutdown while playersLeft > 0 do bindableEvent.Event:Wait()
end end) <--------- where the error is

0
This is from alvin_Blox's how to make a roblox game series TheUltimateBluer 2 — 4y
0
It depends on what you want to fix. If it is the entire game you would need multiple scripts for the game. GUN1FY 4 — 4y

1 answer

Log in to vote
1
Answered by
kepiblop 124
4 years ago

On line 98 put the end) in another line like this

1end
2end)
3--the end) should always be the wrapping up part for a function
Ad

Answer this question