#I need help with scripts. i dont have the nerves to do it.

1 messages · Page 1 of 1 (latest)

tame rune
#

z

#

ModuleScript called "HideManager" In ServerScriptService:

#
local HideManager = {}

local hiddenPlayers = {}

function HideManager.IsHidden(player)
    return hiddenPlayers[player] == true
end

function HideManager.ToggleHidden(player)
    if hiddenPlayers[player] then
        hiddenPlayers[player] = nil
        print("[Server] Player unhid:", player.Name)
    else
        hiddenPlayers[player] = true
        print("[Server] Player hid:", player.Name)
    end
end

function HideManager.RemovePlayer(player)
    hiddenPlayers[player] = nil
end

return HideManager
#

Script in sss called "HideToggleHandler":

#
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local HideToggleEvent = ReplicatedStorage:FindFirstChild("HideToggleEvent")
if not HideToggleEvent then
    HideToggleEvent = Instance.new("RemoteEvent")
    HideToggleEvent.Name = "HideToggleEvent"
    HideToggleEvent.Parent = ReplicatedStorage
    print("[Server] Created HideToggleEvent")
else
    print("[Server] Found HideToggleEvent")
end

print("[Server] Server script running")

HideToggleEvent.OnServerEvent:Connect(function(player)
    print("[Server] HideToggleEvent fired by player:", player.Name)

    local char = player.Character
    if not char then
        warn("[Server] No character for", player.Name)
        return
    end

    local hiddenVal = char:FindFirstChild("IsHidden")
    if hiddenVal then
        hiddenVal.Value = not hiddenVal.Value
        print("[Server] Player", player.Name, "IsHidden toggled to", hiddenVal.Value)
    else
        warn("[Server] IsHidden BoolValue missing in character for", player.Name)
    end
end)
#

LocalScript is starterplayerscripts named "HideToggleClient":

#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local HideToggleEvent = ReplicatedStorage:WaitForChild("HideToggleEvent")

local hiding = false

local function updateVisuals(state)
    local char = player.Character
    if not char then return end

    local hum = char:FindFirstChildOfClass("Humanoid")
    if hum then
        hum.WalkSpeed = state and 5 or 16
    end

    for _, part in pairs(char:GetChildren()) do
        if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
            part.Transparency = state and 0.7 or 0
            part.CanCollide = not state
        end
    end
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.E then
        hiding = not hiding
        print("[Client] Pressed E. Toggling hiding to", hiding)
        HideToggleEvent:FireServer()
        updateVisuals(hiding)
    end
end)

player.CharacterAdded:Connect(function()
    hiding = false
    updateVisuals(false)
end)
#

thats all

#

The main game idea:

#

Mom is enemy, patroling the house, when she finds you she will chase you.

You have to do quests and stuff, buy upgrades, do distractions for mom to go there, hide in places and stuff

#

Currently working on hide system, that shit aint working😂😂

#

embed fail

leaden sail
#

I want to help you but I don't find where is the problem lol

#

Is there any error in the output? Or a warn who got called

tame rune
#

Yea, no, i checked the output, but the onyl thing i saw was this

00:26:14.503 [Server] Found HideToggleEvent - Server - HideToggleHandler:10
00:26:14.503 [Server] Server script running - Server - HideToggleHandler:13

#

@leaden sail

leaden sail
#

So there are no errors or warns, only prints?

tame rune
#

that was a warn i think?

leaden sail
#

What is the color of it?

tame rune
#

in the output or script

leaden sail
#

Output

tame rune
#

black

#

(i saw both are print)

leaden sail
#

If there are no errors or warns then it's a Logic error

tame rune
#

hm

leaden sail
tame rune
#

yep

#

i'll send video

leaden sail
#

Ty

#

Try waitforchild maybe the humanoid isn't ready

tame rune
leaden sail
#

Don't interact with the proximity prompt, just press E

tame rune
#

i did

leaden sail
#

So?

tame rune
#

oHHH

#

So like that

#

it works

#

but i want it to work with the pp

#

but i gtg

#

bby

ebon steppe
tame rune
leaden sail