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

[ANSWERED ]Where did i go wrong with simple RemoteEvent script?

Im genuinely confused right now

Local Script :

-- Before this part of this script are just code that collect humanoids and put them in a table

sendDamage(target) -- 'target' here is just a table filled with humanoids
function sendDamage (targets)
	print('fired')
	repli.Events.Damage:FireServer(targets)
end

Server script :

local repli = game:GetService("ReplicatedStorage")
repli.Events.Damage.OnServerEvent:Connect(function(ply, targets)
	print ("Test")
	for i,v in pairs(targets)do
		v:Damage(20)
	end
end)

Output :

fired

Theres no error in the output, it has "fired" which means sendDamage function ran

there is no "Test" which means OnServerEvent did not run

What is going on??!

Info that might help :

  • repli.Events is a folder object
  • repli.Events.Damage is a RemoteEvent
  • There are no scripts that deletes any object especially the RemoteEvent
  • This was tested on studio play test, and also studio server play test

1 answer

✓ Accepted answer

I'm dumb, i put the Server Script on replicatedstorage instead of ServerScriptService

Script does not run on the storage

This info might help people in the future so im not gonna delete this post

also website devs, pls let poster mark their own answer as answer pls, u dont need to give us good boi points for marking our own answer

3 comments

0

hi ok. just 4 u :)

0

hi ok. just 4 u :)

0

thxx ;0

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