Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script was working then without modifications stopped working?

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

1 comment

0

Is your game published or not?

1 answer

✓ Accepted answer

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

3 comments

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.

0

OHHHHHH ok so ServerScriptService was accidentally named something else

0

lol

This discussion is preserved as it was. New answers, comments, and votes are closed.