#why is my code blind

1 messages · Page 1 of 1 (latest)

signal relic
#

I think the error is very explanatory, but basically, my LocalScript doesn't know that ServerStorage has the thing that I told it to look for, and there is no other script instructing it to autodestroy itself.

#

i should say that the serverstorage appears to empty itself when i run the game...

mystic sandal
#

ServerStorage can not be accessed by the client

#

You need to use the replicated storage instead

signal relic
#

yeah it works ty

sharp needle
signal relic
sharp needle
signal relic
sharp needle
#

And was wondering why my debounce wasn’t working properly

sharp needle
#

Something like

if not player or debounce[player] then debounce[player] = nil return end
debounce[player] = true```
signal relic
#

yeah no idea what that is

sharp needle
#
local players = Game:GetService(“Players”)
local part = Workspace:WaitForChild(“Part”)
local debounce = {}

part.Touched:Connect(function(hit)
    local char = hit.Parent
    local player = players:GetPlayerFromCharacter(char)
if not player or debounce[player] then return end
debounce[player] = trueinsert other logic here maybe for collecting money idk
end)```
#

Too lazy to finish because I’m on mobile

#

But you get the idea

signal relic
sharp needle
#

Without a debounce, touching a part that’s supposed to give like 5 coins could give 15 due to multiple touches being triggered

signal relic
#

lemme show you something

sharp needle
#

Yes yes

#

I went a bit off topic sorry

signal relic
#

do you think i understand what a debounce is when my code looks like THIS?

sharp needle
#

You should learn what a debounce is :D

signal relic