I have a script which randomly drops boxes around the map. The code is thus:
local function randomBoxSpawner()
local boxName = randomBoxChooser()
local boxCopy = serverStorage.Boxes:FindFirstChild(boxName):Clone()
local prize = boxCopy:WaitForChild("Prize").Value
local debounce = true
if boxCopy and prize then
boxCopy.Parent = game.Workspace
boxCopy.CFrame = randomLocationProvider()
debris:AddItem(boxCopy, debrisWaitTime)
boxCopy.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and humanoid.Health > 0 then
if debounce then
local player = players:GetPlayerFromCharacter(hit.Parent)
local playerInfo = serverStorage:FindFirstChild(player.Name).PlayerInfo
if playerInfo.OwnsTycoon.Value then
debounce = false
awardBoxPrize(boxCopy, playerInfo, prize)
end
end
end
end)
end
end
The problem is that when I touch the box in a server it takes about one to two seconds to disappear. I thought about fading it out with a for loop but still would it not lag? What is a way that I can fix this? Quick note: I am not asking for a script, just a way to understand and fix this "problem". Thanks!

4 comments
Your best bet is to have the client do a little bit of fading on their own while the server processes what happens, there's a wiki tutorial that's kinda related here http://robloxdev.com/articles/Fighting-Against-Lag
I have already read that.
I just don't know how I would do that. Do I need to use remote events/functions?
Yes, you would need to use Remote Events.