Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

ServerScriptService is not a valid member of DataModel?

Asked by 8 years ago

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

001--Libraries
002local player = game.Players.LocalPlayer
003local char = player.CharacterAdded:wait()
004local mouse = player:GetMouse()
005local cam = workspace.CurrentCamera
006local rs = game:GetService('RunService').RenderStepped
007local uis = game:GetService('UserInputService')
008 
009--Fundmental Modules
010local gs = require(game.ReplicatedStorage.Modules.Fundementals.GameSettings)
011local eai = require(game.ServerScriptService:WaitForChild("Modules").Classes.Enemy.EmemyAi)
012 
013--Events
014local events = game.ReplicatedStorage.Events
015local signal = events:WaitForChild("Signal")
View all 116 lines...

1 answer

Log in to vote
2
Answered by
Decemus 141
8 years ago

Use game:GetService('ServerScriptService') instead. Sometimes it may not load it right away, so just do that to get it.

Ad

Answer this question