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

This script I've created doesn't save, but has no errors. Please help?

Asked by 6 years ago

So, here's the script:

001local ReplicatedStorage = game:GetService("ReplicatedStorage")
002local DS = game:GetService("DataStoreService"):GetDataStore("Statsandstuff")
003 
004 
005game.Players.PlayerAdded:Connect(function(plr)
006    local player = plr
007    repeat wait() until player.Character
008 
009    local hitbox = Instance.new("Part")
010    local weld = Instance.new("Weld",hitbox)
011    hitbox.Parent = player.Character
012    hitbox.Name = "PlayerHitBox"
013    hitbox.Size = Vector3.new(3.85, 5.74, 1.19)
014    hitbox.Position = Vector3.new(player.Character.UpperTorso.Position.X,player.Character.UpperTorso.Position.Y - 2,player.Character.UpperTorso.Position.Z)
015    hitbox.Transparency = 1
View all 101 lines...

I get no errors whatsoever, but it won't save. Please help!

0
Ignore the hitbox stuff, that is irrelevant. AgencyDrone 0 — 6y
0
Player removing must be changed to game:BindToClose because Player removing doesn't work any more for datastores greatneil80 2647 — 6y
0
Possibly on line 7 have wait() until plr.Character.Loaded == true iladoga 129 — 6y
0
So whenever I use BindToClose it stalls the game and nearly crashes studio until saying it didn't work and is either in a queue or stopped the script. AgencyDrone 0 — 6y

Answer this question