Local Script
local player = game.Players.LocalPlayer
local tweenservice = game:GetService('TweenService')
local module = require(game.ReplicatedStorage.Modules.Abbreviate)
local r = Random.new()
local Time = 0.26
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Remotes.Add:FireServer(player)
game.ReplicatedStorage.Music.ClickEffect:Play()
script.Parent:TweenSize(UDim2.new(0.045, 0, 0.085, 0), nil, nil, 0.05)
wait(0.05)
script.Parent:TweenSize(UDim2.new(0.087, 0,0.13, 0), nil, nil, 0.05)
--if game.ReplicatedStorage.Values.Popups.Value == true then
-- local clonedPopup = game.ReplicatedStorage.Popup:Clone()
-- clonedPopup.Parent = script.Parent.Parent
-- clonedPopup.Rotation = math.random(-50, 50)
-- clonedPopup.Position = UDim2.new(r:NextNumber(0,1),0,1,0)
-- clonedPopup:TweenPosition(UDim2.new(r:NextNumber(0,1),0,r:NextNumber(0,0.6),0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, Time)
-- local rotationTween = tweenservice:Create(clonedPopup, TweenInfo.new(0.5), {Rotation = math.random(-90, 50)})
-- rotationTween:Play()
-- wait(1)
-- local tween = tweenservice:Create(clonedPopup, TweenInfo.new(1), {TextTransparency = 1})
-- tween:Play()
-- wait(1)
-- clonedPopup:Destroy()
--end
end)
ServerScript
game.ReplicatedStorage.Remotes.Add.OnServerEvent:Connect(function(player)
local amount = 1 * (player.leaderstats.Rebirths.Value + 1) * (player.Multiplers.TapsMultipler.Value) * module:GetPetMultipliers(player, 'Water') * (player.Gamepasses.x2Clicks.Value)
player.leaderstats.Water.Value = player.leaderstats.Water.Value + (amount)
print(module:GetPetMultipliers(player, 'Water'))
end)
No errror is shown in the output and the clicking doesnt work
xam345
(xam345)
2
Does the MouseButton1Click event fire? Try putting a print statement inside the function to make sure when you click it goes off.
in the server script, it prints every times it fires.
xam345
(xam345)
4
try printing
on the server script to see if you can access that value
xam345
(xam345)
5
also, is âmoduleâ defined in the server script?
everything is defined properly.
xam345
(xam345)
7
Is it possible that your amount value equals zero?
By the way the 1* in the beginning of the amount is not needed
xam345
(xam345)
8
Try setting amount to a random number to see if
works
The amount is set to zero yes. It is in the player added event of my script
xam345
(xam345)
10
Is the local amount in this function also zero?
if so then player.leaderstats.Water.Value will appear to not change
yeah placing a random number worksâŚ
wdym function set to zero. it multiples 1 by the rebirths value, taps multipler and pet stats
xam345
(xam345)
13
Great! We isolated the problem.
try printing
player.leaderstats.Rebirths.Value
player.Multipler.Value
module:GetPetMultipliers(player,âWaterâ)
player.Gamepasses.x2Clicks.Value
to see which one equals zero
it is x2Clicks that is set to zero in the player addded event it is set to one tho?
xam345
(xam345)
15
Make sure x2Clicks is set to 1. If it is zero, then the amount will be zero.
Ex: 5x0 = 0 whereas 5x1 = 5
yeah it is set to 1 though. thats the issue
xam345
(xam345)
17
Something else must be setting it to zero then. When you playtest the game, is the value of x2Clicks 0?
xam345
(xam345)
19
Are there any other functions that change x2Clicks.Value?
no i am looking and nothing is