#RenoteEvent doesn’t work
1 messages · Page 1 of 1 (latest)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Morph = ReplicatedStorage:WaitForChild("Morph")
local SpawnMorph = ReplicatedStorage:WaitForChild("SpawnMorph")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Weapons = require(script.Weapons)
local spawnPoints = {
["Spawn1"] = workspace:WaitForChild("SpawnGAR"),
["Spawn2"] = workspace:WaitForChild("SpawnRaider"),
}
SpawnMorph.OnServerEvent:Connect(function(player, divisionName, morphName, spawnName)
print("Spawn")
local folder = Morph:FindFirstChild(divisionName)
if not folder then
warn("Divisione non trovata:", divisionName)
return
end
local model = folder:FindFirstChild(morphName)
if not model then
warn("Morph non trovato:", morphName)
return
end
local spawnLocation = spawnPoints[spawnName]
if not spawnLocation then
warn("Spawn non trovato:", spawnName)
return
end
local clone = model:Clone()
clone.Name = player.Name
clone:SetPrimaryPartCFrame(spawnLocation.CFrame + Vector3.new(0, 5, 0))
player.Character = clone
clone.Parent = workspace
print(player.Name .. " spawnato come morph " .. morphName .. " in " .. spawnName)
end)
--[[local function GiveWeapons(player, groupID, morph)
if player:WaitForChild("leaderstats").Arrested.Value == true then
return
end
for i,v in pairs(Weapons) do
for _,weapon in pairs(v.Weapons) do
if v.Id ~= groupID then
continue
end
if not player.Backpack:FindFirstChild(weapon.Name) then
weapon:Clone().Parent = player.Backpack
end
end
end
for _, divguns in pairs(morph:GetChildren()) do
if divguns:IsA("Tool") then
if not player.Backpack:FindFirstChild(divguns.Name) then
divguns:Clone().Parent = player.Backpack
end
end
end
end]]
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local selectGAR = playerGui:WaitForChild("SelectGAR")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnMorph = ReplicatedStorage:WaitForChild("SpawnMorph")
local spawnButton = script.Parent
spawnButton.MouseButton1Click:Connect(function()
local selectedDivision = player:FindFirstChild("SelectDivision")
local selectedMorph = player:FindFirstChild("SelectMorph")
print("pulsante premuto")
if selectedDivision and selectedMorph then
if selectedDivision.Value == "" or selectedMorph.Value == "" then
warn("Devi selezionare divisione e morph prima di spawnare.")
return
end
print("carica morph")
SpawnMorph:FireServer(selectedDivision.Value, selectedMorph.Value, "Spawn1")
selectGAR.Enabled = false
else
warn("SelectDivision o SelectMorph non trovati nel player.")
end
end)
I have SpawnMorph event in the ReplicatedStorage
If you'd worked with RemoteEvents, you'd know why already. Plus I don't this you wrote this script.
You should try making a RemoteEvent work by yourself from scratch in RS
Do you want to help me or not?
If you don't want to, you can also not write.
No!
whats the line that has the error
No error
Is it local or no local
What?
This?
Or this?
i thought there were both a single script lol
on what line of the local script are you firing to server
Here after my print()
The print is working
But the first print in the script doesnt work.
I think I have a problem in load parameters
idk
if the client:fireserver print works, but the server one does not, then either you got the remote event path wrong (doesnt seem to be the case) or the server script is not running (you can doubly check that by putting a print outside of any functions in that script). one reason its not running is its in a place scripts dont run, or it has errors
fairly basic debugging steps y'know make sure things are in the right place, spelled correctly, test confirm things are actually running. basic, basic stuff.
Ok I will add an extra print
** You are now Level 6! **
Give me 1 sec
and obviously if you're getting any errors at all, you can't expect anything else to work
definitely not errors or warnings, and completely unrelated to things not working. let's keep believing that, and maybe pray to the roblox luau jesus to bestow a magical miracle upon your code to fix itself. hmm yes indeed no need to investigate those errors or warnings any further at all. roblox luau jesus will save you!
Bro.
fix your errors and warnings -_-
Those are errors related to doors
I fixed
tbh you could prove its the errors by creating a new script with nothing but a connection to the event and a print in it, nothing else
ye that can error
if the require infinite yields, that is just as much a problem
so ye this is called error cascade - it's when an error or other problem, such as infinite yield, happens early on in the code, nothing after that error will work properly. sometimes you get lucky, sometimes you don't.
A cascading failure is a failure in a system of interconnected parts in which the failure of one or few parts leads to the failure of other parts, growing progressively as a result of positive feedback. This can occur when a single part fails, increasing the probability that other portions of the system fail. Such a failure may happen in many ty...
Do you know how to remove Kohl admin for a member?
bruh idk what your admin module is i make my own stuff
Oh ok thank u man
google is your friend
as far as you think you know 
