-
-
Notifications
You must be signed in to change notification settings - Fork 479
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
Using the script below doesn't work.
Steps to reproduce
Create a server-side script with this: (sorry, this website doesn't support indentation nor highlights)
addEventHandler ("onElementModelChange", root, function (oldModel, newModel)
if (getElementType (source) == "player") then
if (newModel == 12) then
outputChatBox ("Skin locked! You can't use it.", source, 255, 30, 30)
setElementModel (source, oldModel) -- According to Wiki, this should work.
end
end
end)
Expected behaviour
Skin should change back.
How to "fix" the issue
Just make setElementModel inside a timer, like this:
addEventHandler ("onElementModelChange", root, function (oldModel, newModel)
if (getElementType (source) == "player") then
if (newModel == 12) then
outputChatBox ("Skin locked! You can't use it.", source, 255, 30, 30)
setTimer (function (thePlayer)
setElementModel (thePlayer, oldModel)
end, 100, 1, source)
end
end
end)
Version
Both v1.5.6-release-16616
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working