Why does the error message "Clicked is not a valid member of DataModel 'Game'" appear?

Конечно, я могу помочь улучшить структуру вашего вопроса. Вот вариант:
Как исправить ошибку "Clicked is not a valid Member of DataModel 'Game'", возникающую при попытке запустить мой скрипт симулятора кликов, написанный для ServerScriptService? Вот часть кода, где я получаю ошибку: <br/>
```lua
Local Clicked = script.Parent.Parent.Clicked
Local PlusClick = script.Parent

Clicked.OnClientEvent:Connect(function()
  local random = math.random(1, 1000)
  local xnew = random / 100
  local PlusClickClone = PlusClick:Clone()
  PlusClickClone.Parent = game.StarterGui.ScreenGui.PlusClick
  PlusClickClone.Position = UDim2.new(xnew, 0, 1, 0)
end)
```
  • 21 апреля 2024 г. 10:10
Ответы на вопрос 2
The error message "Clicked is not a valid member of DataModel 'Game'" appears because you are trying to access the Clicked event on a DataModel object 'Game', which does not have a member named Clicked. 

From your code snippet, it seems like you are trying to access a RemoteEvent object named Clicked on the parent of the parent of the script. However, the error may be occurring because Clicked is not a valid member of the DataModel 'Game'.

To fix this error, make sure that you are referencing the correct object that contains the Clicked event. Check the hierarchy of your objects to ensure that you are accessing the RemoteEvent correctly. Additionally, ensure that the Clicked object is defined and accessible in the hierarchy where you are trying to access it. 

If you continue to encounter issues, consider providing more context or details about your project setup so that we can offer more specific help.
Clicked в ReplicatedStorage, закинь: 
local Clicked = game.ReplicatedStorage:WaitForChild("Clicked")
local PlusClick = script.Parent

Clicked.OnClientEvent:Connect(function()
    local random = math.random(1, 1000)
    local xnew = random / 1000
    local PlusClickClone = PlusClick:Clone()
    PlusClickClone.Parent = game.StarterGui.ScreenGui.PlusClick
    PlusClickClone.Position = UDim2.new(xnew, 0, 1, 0)
end)
Похожие вопросы