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

Alvinbox inventory guide, this script does not give the player weapon, why?

Asked by 5 years ago
Edited 5 years ago

TOOL SPAWNER SCRIPT =

wait(5) -- Put the following code in your script at the point where you want players to get their tool.

for i, v in pairs(game.Players:GetPlayers()) do if v.EquippedTool.Value == "" then

-- Give them a basic tool else local tool = game.ServerStorage[v.EquippedTool.Value]:Clone() tool.Parent = v.Backpack end end

HERE IS THE DATA SCRIPT =

local DSService = game:GetService('DataStoreService'):GetDataStore('Videoscript32') game.Players.PlayerAdded:connect(function(plr)

-- Define variables local uniquekey = 'id-'..plr.userId local leaderstats = Instance.new('IntValue', plr) local savevalue = Instance.new('StringValue') leaderstats.Name = 'leaderstats' savevalue.Parent = plr savevalue.Name = 'EquippedTool'

-- GetAsync local GetSaved = DSService:GetAsync(uniquekey) if GetSaved then savevalue.Value = GetSaved[1] else local NumbersForSaving = {savevalue.Value} DSService:SetAsync(uniquekey, NumbersForSaving) end end) game.Players.PlayerRemoving:connect(function(plr) local uniquekey = 'id-'..plr.userId local Savetable = {plr.EquippedTool.Value} DSService:SetAsync(uniquekey, Savetable)

end)

HERE IS THE SCRIPT FOR MOUSE CLICKING THE GUI =

script.Parent.MouseButton1Click:Connect(function()

game.Players.LocalPlayer.EquippedTool.Value = tostring(script.Parent.Name) end)

0
Here is the Data script for this guide: slinky22 0 — 5y
0
please use codeblocks The_Pr0fessor 595 — 5y
0
Don't copy paste and actually learn what your copying. nicktooner 119 — 5y
0
what does that even mean nicktooner greatneil80 2647 — 4y

Answer this question