Sorry for re posting the last time I on mistake clicked the solved error button when it the comment didn't fix it. Local Script
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 | local debounce = false |
03 | UserInputService.InputBegan:Connect( function (input) |
04 | if input.KeyCode = = Enum.KeyCode.E then |
05 | if debounce = = false then |
06 | game.Players.LocalPlayer.PlayerGui.e.Frame.ePower.Visible = false |
07 | script.EventPepporni:FireServer() |
08 | local debounce = true |
09 | wait( 3 ) |
10 | local debounce = false |
11 | game.Players.LocalPlayer.PlayerGui.e.Frame.ePower.Visible = true |
12 | end |
13 |
14 | end |
15 | end ) |
Normal Script
1 | game.StarterPlayer.StarterCharacterScripts.Pepporni.EventPepporni.OnServerEvent:Connect( function () |
2 | print ( "it worked!!" ) |
3 | local plr = script.Parent.Parent.Name |
4 | local plrpos = game.Workspace:FindFirstChild(plr.name) |
5 | local part = Instance.new( "Part" ) |
6 | part.parent = game.Workspace |
7 | end ) |
This is because instead of the event being in the starter character scripts it should be in the replicated storage. Also, it wouldn't be in starter character scripts folder, it would be in the players character.