diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 88ebc7b..59b697d 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -369,12 +369,13 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{ "GetService"=>cf!(|lua,_this,service:mlua::String|{ dom_mut(lua,|dom|{ //dom.root_ref()==this.referent ? - match &*service.to_str()?{ - "Lighting"=>{ - let referent=find_first_child_of_class(dom,dom.root(),"Lighting") + let service=&*service.to_str()?; + match service{ + "Lighting"|"RunService"=>{ + let referent=find_first_child_of_class(dom,dom.root(),service) .map(|instance|instance.referent()) .unwrap_or_else(|| - dom.insert(dom.root_ref(),InstanceBuilder::new("Lighting")) + dom.insert(dom.root_ref(),InstanceBuilder::new(service)) ); Ok(Instance::new(referent)) },