Tool does not work

Hi! I am a new scripter, and I am stuck with this script. I have tried for like 30 min to fix it by myself, but I don’t know how to fix it. You can check the error picture.

--Variables
local EventModule = require(game.ServerStorage.EventModule)
local RemoteEvents = game.ReplicatedStorage.RemoteEvents

--Functions
RemoteEvents.AddSlushieEvent.OnServerEvent:Connect(function(player, ValueFolder)
    local leaderstats = player:WaitForChild("leaderstats")
    leaderstats.Slushies.Value = leaderstats.Slushies.Value * ValueFolder.AmountGive.Value *{EventModule.EventBoost + 1}
end)

The EventModule (I dont know if I did this right)

local EventBoost = {
	
	["EventBoost"] = 1;
}

return EventBoost

Tool Script

--Variables
local Debounce = false
local SlushieTool = script.Parent

--Functions
SlushieTool.Activated:Connect(function()
	if Debounce == false then
		Debounce = true
		game.ReplicatedStorage.RemoteEvents.AddSlushieEvent:FireServer(script.Parent.Values.AmountGive)
		wait(0.3)
		Debounce = false
	end
end)

Error

Hope you can help me out.

In your values folder you don’t need the AmountGive part, just delete that and leave the value part.

You passed the Instance AmountGive in the RemoteEvent, but then you seem to have accidentaly named it and used it as if it was the folder in which AmountGive is. Just remove ValueFolder in the Server-side script, or remove the AmountGive between ValueFolder and Value.

What might be even better is only sending the AmountGive.Value through the Remote Event since you are only using that piece of information anyway. Less trafic that way!

1 Like

For example:
ValueFolder.AmountGive.Value to this ValueFolder.Value

Ok I’ll try doing that. Hope it will work