#local script not getting signal from server when its in a gui

1 messages · Page 1 of 1 (latest)

sour cosmos
#

im not sure how this is even happening but ill show the code within the local script and server script

local script:

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

local player = Players.LocalPlayer
local char = player.Character
local cam = workspace.CurrentCamera

local gui = script.Parent
--local ingame = gui:WaitForChild("InGame")

local remotes = ReplicatedStorage.Remotes

remotes.Local.CameraSubject.OnClientEvent:Connect(function(newchar, stat)
print("new character")
end)

server script:

function module.LoadSurvivor(player:Player, survivor)
if not player then return end
local char = assets.Survivor:FindFirstChild(survivor)
local stat = stats.Survivor:FindFirstChild(survivor)
if not char or not stat then return end
stat = require(stat)
char = char.Default:Clone()
local hum = char:WaitForChild("Humanoid")
char.Parent = ingame.Survivors
char.Name = player.Name
char:PivotTo(player.Character:GetPivot())
player.Character = char
char.Animate.Enabled = true
remotes.Local.CameraSubject:FireClient(player, char, stat)
char:SetAttribute("Sprinting", false)
char:SetAttribute("WalkSpeed", stat.WalkSpeed)
char:SetAttribute("SprintSpeed", stat.SprintSpeed)
hum.WalkSpeed = stat.WalkSpeed
hum.MaxHealth = stat.Health
hum.Health = stat.Health

player:SetAttribute("Icon", stat.Icon)

end

carmine jolt
#

since you already defined LocalPlayer you can just get the PlayerGui from there and then the actual GUI itself.

#

iirc

sour cosmos
#

Oh

#

Yea that’s smart and I’ll prob just do that