ServerScriptService is not a valid member of DataModel?
The script works flawlessly with no errors in studio, but when i play in game, i get the error ServerScriptService is not a valid member of DataModel
on line 11. Anyone know why?
Local Script
002 | local player = game.Players.LocalPlayer |
003 | local char = player.CharacterAdded:wait() |
004 | local mouse = player:GetMouse() |
005 | local cam = workspace.CurrentCamera |
006 | local rs = game:GetService( 'RunService' ).RenderStepped |
007 | local uis = game:GetService( 'UserInputService' ) |
010 | local gs = require(game.ReplicatedStorage.Modules.Fundementals.GameSettings) |
011 | local eai = require(game.ServerScriptService:WaitForChild( "Modules" ).Classes.Enemy.EmemyAi) |
014 | local events = game.ReplicatedStorage.Events |
015 | local signal = events:WaitForChild( "Signal" ) |
021 | signal.OnClientEvent:connect( function (ver,p 1 ,p 2 ,p 3 ) |
023 | SetupTurret = function () |
031 | local t = game.ReplicatedStorage.Assets.Turrets.RTurret:Clone() |
035 | uis.InputBegan:connect( function (io,gpe) |
036 | if io.KeyCode = = Enum.KeyCode.R and clp = = true then |
037 | if t:isA( 'Model' ) then |
038 | if t.PrimaryPart ~ = nil then |
039 | t:SetPrimaryPartCFrame(t:GetPrimaryPartCFrame()*CFrame.Angles( 0 ,math.rad( 5 ), 0 )) |
040 | lastrot.y = t.PrimaryPart.Rotation.Y |
042 | warn( "Set Primary Part to base..." ) |
044 | elseif t:isA( 'BasePart' ) then |
045 | t.CFrame = t.CFrame*CFrame.Angles( 0 ,math.rad( 5 ), 0 ) |
046 | lastrot.y = t.Rotation.Y |
051 | local function castRay(o,o 2 ) |
052 | local mag = (o.PrimaryPart.Position-o 2. Position).magnitude |
053 | local beam = Instance.new( 'Part' ) |
054 | beam.BrickColor = BrickColor.new( 'Really Red' ) |
055 | beam.Material = 'Neon' |
056 | beam.Transparency = 0 |
058 | beam.CanCollide = true |
059 | beam.Size = Vector 3. new( 0.3 , 0.3 ,mag) |
060 | beam.CFrame = CFrame.new(o.PrimaryPart.Position,o 2. Position)*CFrame.new( 0 , 0 ,-mag/ 2 ) |
062 | game:GetService( "Debris" ):AddItem(beam, 4 ) |
065 | local function trackEnemies(o) |
071 | if #gs.CurrentCourse.Enemies:GetChildren()~ = 0 then |
073 | for n,e in pairs (gs.CurrentCourse.Enemies:GetChildren()) do |
075 | local mag = (o.PrimaryPart.Position-e.Position).magnitude |
082 | castRay(o, closestpart) |
083 | signal:FireServer( 'Backdoor' , 'DestroyEnemy' ,closestpart) |
092 | mouse.Button 1 Down:connect( function () |
097 | mouse.TargetFilter = t |
099 | rs:connect( function () |
101 | if mouse.Target ~ = nil then |
102 | if mouse.Target.Parent.Parent = = gs.CurrentCourse then |
103 | signal:FireServer( 'Backdoor' , 'UpdateTurretPosition' ,t, |
104 | CFrame.new(mouse.Target.Position.X,((t.PrimaryPart.Size.Y/ 2 )+mouse.Target.Position.Y)+ 0.5 ,mouse.Target.Position.Z)*CFrame.Angles( 0 ,lastrot.y, 0 )) |
111 | if ver = = 'Backdoor' then |
113 | elseif ver = = 'Frontdoor' then |
114 | signal:FireServer( 'Backdoor' ,p 1 ,p 2 ,p 3 ) |