Made a simple server to client script so that when a player does a certain quest a wall will be client sided to be open/cannot collide but the remote event never fires.
server
local wall = game.Workspace.QuestWalldetector
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local PlayerData = require(ServerScriptService.PlayerData.Manager)
local Event = ReplicatedStorage.CheckIfQuest
wall.Touched:Connect(function(Hit)
local Humanoid = Hit.Parent:WaitForChild("Humanoid")
if Humanoid then
local player = game.Players:GetPlayerFromCharacter(Humanoid.Parent)
local profile = PlayerData.Profiles[player]
if not profile then return end
local QuestReceived = profile.Data.QuestReceived
if QuestReceived == true then
--it does make it here, I checked with print()
Event:FireClient(player)
end
end
end)
client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.CheckIfQuest
local wall = script.Parent
Event.OnClientEvent:Connect(function()
--if i print() something here, it does not print.
wall.CanCollide = false
end)
You did :WaitForChild(“Humanoid”) then did if Humanoid. I assume you want :FindFirstChildWhichIsA(“Humanoid”). In fact you don’t need to Humanoid at all since you’re interested in
local player = game.Players:GetPlayerFromCharacter(Hit.Parent)
Then do if player instead.