Alright, so this might be annoying but youāll have to change the scripts for the toolsā¦
Iāll tell you in a minute
The tools do not have a script at all.
Only the scripts inside of ItemNeededScripts are where the tool is used. Example of one of the scripts:
local plank = game.Workspace.ItemNeeded.PlankNeeded1
local db = false
plank.Touched:Connect(function(Hit)
if db == false then
db = true
end
if Hit.Parent.Name == "Plank" then
plank.CanCollide = true
plank.BillboardGui1:Destroy()
plank.Transparency = 0
Hit.Parent:Destroy()
wait(0.5)
script:Destroy()
db = false
end
end)
Ah ok, Iām going to send the new version of the data store thing, then Iāll show you an example.
I use this script for my games, completely made by me.
So in the script for the door, do
local DataModule = require(game:WaitForChild("ReplicatedStorage"):WaitForChild("DataModule"))
then when the door is unlocked put
DataModule.SetSpecificPlayerData(Player.Name, String, Value)
the string is the value to set for ex. Plank_1_Unlocked.
You can also request data from the module, that can be used to unlock the previously unlocked doors when the player joins.
Ah okay. Do you just want me to make a model with the stuff and scripts, so it can be easier for you to categorize them?
I honestly would just say you know, let me implement it into your gameā¦ but I donāt want to be rude / invading. If you want sure?
If you want, I can implement it into your game.
Here is just a model of the current tool things in my game. Let me know when you got it.
Alright so if you can also hand me the doors (sorry lol) I can create the system to go along with that.
The doors? Like the ice key, pickaxe, and bombs? If so, they are in the model.
Oh sorry, I didnāt see that lol.
Alright all you gotta do is put this model back to its place and it should work, lemme know otherwise and Ill try to fix it.
So, do I still keep the ItemNeededScripts?
hold on I think I forgot to do something
lemme check one sec
Alright, now just put replace the item needed scripts with this modelās item needed scripts:
One more question, shouldnt do remote event go into replicatedstorage?
No that is for the blocks only being invisible for the client, speaking of that I also forgot one other thing which is an easy fix (sorry im tired lol) one sec ill get back to you.
Replace the datastore script in serverscript service with this code
local DataModule = require(game.ReplicatedStorage.DataStoreModule)
local DSS = game:GetService("DataStoreService")
local PlayerDataStore = DSS:GetDataStore("PlayerData")
game.Players.PlayerAdded:Connect(function(Player)
local Success, Data = pcall(function()
return PlayerDataStore:GetAsync(Player.UserId)
end)
warn("Success:", Success)
warn("Data:", Data)
if Success and Data then
DataModule.SetPlayerData(Player.Name, Data)
elseif Success and not Data then
warn("Unable to get "..Player.Name.."'s data, they are a new player!")
DataModule.SetPlayerDataDefault(Player.Name)
elseif not Success and not Data then
Player:Kick("Error while connecting to roblox datastore, please rejoin or try again later.")
error("Unable to get "..Player.Name.."'s data, unable to connect to datastores.")
end
for i, v in pairs(Data) do
if workspace:FindFirstChild(i) ~= nil then
if v == true then
Player.PlayerScripts:WaitForChild("UnlockEvent"):FireClient(Player, workspace:FindFirstChild(i))
end
end
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
local PlayerData = DataModule.RequestPlayerData(Player.Name)
if PlayerData ~= nil then
warn("Saving "..Player.Name.."'s Player data as", PlayerData)
local Success, ErrorCode = pcall(function()
PlayerDataStore:SetAsync(Player.UserId, PlayerData)
end)
if not Success then
warn(ErrorCode)
else
local Success, Data = pcall(function()
PlayerDataStore:GetAsync(Player.UserId)
end)
warn(Data)
end
end
end)
Thank you, but there is a bit of a problem. For the planks, I can not place them at all.
Ah ok can you send me any errors in the output?