I am trying to make the players role change when he/she joins the game.
error → ServerScriptService.RoleChangeEventScript:8: invalid argument #3 (string expected, got boolean)
server script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("ChefRoleChangeEvent")
-- Create a new part
local function onChangeRole(player, stringvalue)
print(player.Name .. " fired the remote event")
player.Role.Value = stringvalue
end
-- Call "onCreatePart()" when the client fires the remote event
remoteEvent.OnServerEvent:Connect(onChangeRole)
local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local stringvalue = ""
local remoteEvent = ReplicatedStorage:WaitForChild("ChefRoleChangeEvent")
-- Include additional data when firing the event
remoteEvent:FireServer(stringvalue == "Chef")