hi, i have a system where a proximity prompt is triggered which fires a remote event which increases a value. in roblox studio, it works correctly and adds 1 however, in game it breaks and adds 3 to the value (increases depending on player count)
server script
script.Parent.Parent["Mystery Egg Mesh"].ProximityPrompt.Triggered:Connect(function(player)
script.Parent.Parent.Name = "desEgg"
game.ReplicatedStorage.giveEgg:FireClient(player)
game.ReplicatedStorage.desEgg:FireClient(player)
script.Parent.RainbowParticles.Enabled = true
task.wait(0.3)
script.Parent.RainbowParticles.Enabled = false
script.Parent.Name = "egg"
end)
local script
game.ReplicatedStorage.giveEgg.OnClientEvent:Connect(function(player)
game.SoundService.Ding:Play()
game.ReplicatedStorage.giveEgg2:FireServer(player)
end)
game.ReplicatedStorage.desEgg.OnClientEvent:Connect(function(player, Egg)
task.wait(0.8)
local des = game.Workspace.EasterEvent:WaitForChild("desEgg"):Destroy()
end)
server script
local data = DataManager:GetData(player)
game.ReplicatedStorage.giveEgg2.OnServerEvent:Connect(function(player, egg)
local egg = player.FoundEggs.Eggs.Value
player.FoundEggs.Eggs.Value += 1
game.ReplicatedStorage.eggupdate:FireClient(player)
if player.FoundEggs.Eggs.Value >= 12 then
if complete.Value == 0 then
complete.Value = 1
print("Done!")
data.Tix += 250
--MarketplaceService:PromptPurchase(player, 00000000) -- put free ugc itemid in here
end
end
end)
end)