So, everything in here works, but the only problem is that my leaderstats values are not affected. I don’t get any outputs so I cant figure out what is wrong.
local rewardevent = game.ReplicatedStorage.Quest.Bandits:WaitForChild(“2BanditsReward”)
Hi, Unfortunately I don’t have long to stick around but here’s a few things I suggest trying:
Check if rewardevent actually exists
Put a print in the rewardevent.OnServerEvent function and see if the code ever runs
Make sure your leaderstats actually exist
Hope this helps you
local rewardevent = game.ReplicatedStorage.Quest.Bandits:WaitForChild("2BanditsReward")
rewardevent.OnServerEvent:Connect(function(player)
--Test a print here to see if the event is ever been run
local CoinBoost = player.CoinBoost
local EXPBoost = player.EXPBoost
player.leaderstats.Power.Value = player.leaderstats.Power.Value + math.floor(5 * CoinBoost.Value)
player.LevelsInfo.Experience.Value = player.LevelsInfo.Experience.Value + math.floor(5 * EXPBoost.Value)
player.PlayerGui.Killed:Destroy()
player.killedbandits:Destroy()
player.maxbandits:Destroy()
player.Bandits:Destroy()
end)