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

Script was working then without modifications stopped working?

Asked by 4 years ago
local sp = script.Parent
local Players = game:GetService("Players")
local module = require(game.ServerScriptService.ModuleScript)

local debounce = true
local soundEffect = sp.Absorb



local function MagicTouched(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent) 
    if debounce and player and #sp:GetChildren() == 4 then
        debounce = false
        soundEffect:Play()
        sp.Orb:Destroy()
        debounce = true
        module.updateMagic(player,5)
    end
end

sp.Touched:Connect(MagicTouched)

Output ServerScriptService is not a valid member of DataModel

0
Is your game published or not? SilentsReplacement 468 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Use game:GetService("ServerScriptService") instead because the issue is most likely that the service is renamed

0
This fixed the problem, but I don't understand why. When I load an older file of the game it works with the original code, but not in the new. jamespringles 105 — 4y
0
OHHHHHH ok so ServerScriptService was accidentally named something else jamespringles 105 — 4y
0
lol Gameplayer365247v2 1055 — 4y
Ad

Answer this question