fungi3432
(fungi3432)
January 17, 2022, 7:28pm
#63
Don’t replace .OnServerEvent
on that line with .Event
; only change the line that’s relating to the Sell event.
Result:
local ReplicatedStorage = game.ReplicatedStorage
ReplicatedStorage.RemoteEvents.Power.OnServerEvent:Connect(function(player, valueFolder)
if player.Debounce.Value == false then
player.leaderstats.Power.Value = player.leaderstats.Power.Value + valueFolder.Power.Value*(player.leaderstats.Rebirths.Value + 1)
player.Debounce.Value = true
wait(valueFolder.cooldown.Value)
player.Debounce.Value = false
end
end)
ReplicatedStorage.BindableEvents.Sell.Event:Connect(function(player)
if player ~= nil then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + player.leaderstats.Power.Value*2
player.leaderstats.Power.Value = 0
end
end)
fungi3432:
local ReplicatedStorage = game.ReplicatedStorage
ReplicatedStorage.RemoteEvents.Power.OnServerEvent:Connect(function(player, valueFolder)
if player.Debounce.Value == false then
player.leaderstats.Power.Value = player.leaderstats.Power.Value + valueFolder.Power.Value*(player.leaderstats.Rebirths.Value + 1)
player.Debounce.Value = true
wait(valueFolder.cooldown.Value)
player.Debounce.Value = false
end
end)
ReplicatedStorage.BindableEvents.Sell.Event:Connect(function(player)
if player ~= nil then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + player.leaderstats.Power.Value*2
player.leaderstats.Power.Value = 0
end
end)
ok that worked but i still have Cash is not a valid member of Folder “Players.Guest_player1689.leaderstats”
SJxseCA
(SJxseCA)
January 17, 2022, 7:36pm
#66
I agree with this, you’re trying to call for something that doesn’t exist.
fungi3432
(fungi3432)
January 17, 2022, 7:38pm
#67
Scripts are case sensitive. Rename “cash” in the leaderstats to “Cash”.
SJxseCA
(SJxseCA)
January 17, 2022, 7:39pm
#68
If you’re trying to get it to operate from an event activation, you have to first make sure that you have a LocalScript fire it to the server, then you’ll use “OnServerEvent” like on the first function. Do you mind elaborating on what you’re exactly looking to happen?
wow i cant believe i made a typo thanks for your help everything is working now
1 Like
SJxseCA
(SJxseCA)
January 17, 2022, 7:41pm
#70
Based off of this, I think you may be trying to fire the event, for that you have to use . . . :FireServer()
if you are using a local script.