I am watching one of alvinblox's tutorials and I can not figure out what the problem is. I hear --that alvinblox's tutorials are out of date so that could be the problem. can anybody figure out why it will not go through my functions.
local replicatedStorage = game:GetService("ReplicatedStorage") local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData") local cooldown = 1 replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)--this block is the error print("Fired") if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end print("Got pass if statement") local debounce = remoteData[player.Name].Debounce print("Got pass the Debounce Varible") if not debounce.Value then print("got pass debounce if statement") debounce.Value = true player.leaderstats.strength.Value = player.leaderstats.strength.Value + 25 * (player.leaderstats.rebirths.Value + 1) print("got pass leaderstats") wait(cooldown) debounce.Value = false end end) print("Got to end")
local module = require(script.Parent:WaitForChild("ModuleScript")) local player = game.Players.LocalPlayer local mouse = player:GetMouse() script.Parent.Activated:Connect(function() module.Lift() end)
local module = {} local replicatedStorage = game:GetService("ReplicatedStorage") function module.Lift() replicatedStorage.Remotes.Lift:FireServer() end return module
leaderstats script
local serverStorage = game:GetService("ServerStorage") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local strength = Instance.new("NumberValue") strength.Name = "Strength" strength.Parent = leaderstats local rebirths = Instance.new("IntValue") rebirths.Name = "Rebirths" rebirths.Parent = leaderstats local dataFolder = Instance.new("Folder") dataFolder.Name = player.Name dataFolder.Parent = serverStorage.RemoteData local debounce = Instance.new("BoolValue") debounce.Name = "Debounce" debounce.Parent = dataFolder end)
-- this is what you did player.leaderstats.strength.Value = player.leaderstats.strength.Value + 25 * (player.leaderstats.rebirths.Value + 1) -- make sure strength is Strength. same with rebirths. player.leaderstats.Strength.Value += 25 * (player.leaderstats.Rebirths.Value + 1)