So, essentially what I did, was make a ModuleScript for Swords (Simulator Game).
Is this good server checking, or is this pointless?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerEvents = ReplicatedStorage:WaitForChild('ServerEvents')
local ClickEvent = ServerEvents:WaitForChild('ClickEvent')
local DataStore2 = require(ReplicatedStorage:WaitForChild('DataStore2'))
local SwordTable = require(ReplicatedStorage:WaitForChild('SwordModule'))
ClickEvent.OnServerEvent:Connect(function(player, swordValue)
local strengthDataStore = DataStore2("Strength", player)
local swordInfo = SwordTable[swordValue]
local passedName
for _, v in pairs(player.Character:GetDescendants()) do
if v:IsA('StringValue') then
if v.Name == "Sword" then
passedName = v.Value
end
end
end
if swordValue == passedName then
strengthDataStore:Increment(swordInfo.Earnings)
end
end)