Explorer Image
-- Local Script
local sss = game:GetService("ServerScriptService")
local rs = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local player = players.LocalPlayer
local remotes = rs:WaitForChild("Remotes")
local lick4 = remotes.Lick2
local lolipop4 = script.Parent
local mouse = player:GetMouse()
local clicked = false
local licktimeModule = require(rs.toolLick)
local char = player.Character or player.CharacterAdded:wait()
local backpack = player:WaitForChild("Backpack")
local tool_Name4 = script.Parent.Name
local tool4 = script.Parent
local soundService = game:GetService("SoundService")
local sounds = soundService:WaitForChild("Sounds")
local licksound = sounds.lickSound
lolipop4.Activated:Connect(function()
if not clicked then
clicked = true
lick4:FireServer(tool_Name4,tool4)
licksound:Play()
licktimeModule.TringPop1cooldown()
clicked = false
end
end)
-- Server Script
lick2.OnServerEvent:connect(function(player,tool4,tool_Name4)-- TringPop1 Event Fired
warn("Lick2 event fired")
print(tool_Name4)
local dataFolder = playerdata:FindFirstChild(player.Name)
if not dataFolder then
return ("noFile")
else
local lickAdditionValue4 = tool4:FindFirstChild("TringPop1lickValue").Value
player.leaderstats.Licks.Value = player.leaderstats.Licks.Value + lickAdditionValue4
while wait() do
for i,v in pairs (backpack:GetChildren() and char:GetChildren()) do
if v == tool4 or v.Name == tool_Name4 then
print("Tool1 found")
if player.leaderstats.Licks.Value == (136) then
player.leaderstats.Licks.Value = player.leaderstats.Licks.Value - lickAdditionValue4
end
end
end
break
end
end
wait(5)
print(player.leaderstats.Licks.Value)
end)-- TringPop1 Event End

1 comment
Give context for your questions not just a wall of text...